boipushy
boipushy copied to clipboard
Documentation: when to call `input:update()`
I just spent a bit of time figuring out that the reason :down(..)
would work but :pressed(..)
, etc. wouldn't was because I was calling input:update()
before checking the state of the inputs.
It might be worth highlighting this in the README.md
with an example :)
For example:
function love.update(dt)
if input:pressed('down') then print('down was pressed!') end
-- your other input checks here..
input:update()
end
You can submit a Pull Request with the changes in the documentation so that the author could just merge it :)
Thanks @flamendless. I'd be happy to but wanted to confirm this is intended behavior first :) For instance, I found that baton
doesn't work this way.