Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no input recogniced by urutora #5

Open
coliflor opened this issue Oct 16, 2023 · 2 comments
Open

no input recogniced by urutora #5

coliflor opened this issue Oct 16, 2023 · 2 comments

Comments

@coliflor
Copy link

I followed the instructions and it draws what i tell it to draw but then there is no input, I'm unable to interact with the UI elements.
I'm running LOVE 11.4 (Mysterious Mysteries)

local urutora = require 'urutora'
local u

function love.mousepressed(x, y) u:pressed(x, y) end
function love.mousemoved(x, y, dx, dy) u:moved(x, y, dx, dy) end
function love.mousereleased(x, y) u:released(x, y) end
function love.textinput(text) u:textinput(text) end
function love.keypressed(k, scancode, isrepeat) u:keypressed(k, scancode, isrepeat) end
function love.wheelmoved(x, y) u:wheelmoved(x, y) end

function love.update(dt)
u:update(dt)
end
function love.draw()
u:draw()
end

function love.load()
u = urutora:new()

local Text = u.text({
text = 'Click me!',
x = 10, y = 10,
w = 200,
})

u:add(Text)
end

@himanss
Copy link

himanss commented Nov 30, 2023

the documentation is actually wrong, the input glue code is supposed to be

function love.mousepressed(x, y, button) u:pressed(x, y, button) end
function love.mousemoved(x, y, dx, dy) u:moved(x, y, dx, dy) end
function love.mousereleased(x, y, button) u:released(x, y, button) end
function love.textinput(text) u:textinput(text) end
function love.keypressed(k, scancode, isrepeat) u:keypressed(k, scancode, isrepeat) end
function love.wheelmoved(x, y) u:wheelmoved(x, y) end

they are checking if its the left button pressed, nil is not the left button. yikes!

@coliflor
Copy link
Author

coliflor commented Dec 4, 2023

now it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants