urutora icon indicating copy to clipboard operation
urutora copied to clipboard

no input recogniced by urutora

Open coliflor opened this issue 2 years ago • 2 comments

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

coliflor avatar Oct 16 '23 16:10 coliflor

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!

himanss avatar Nov 30 '23 06:11 himanss

now it works

coliflor avatar Dec 04 '23 16:12 coliflor