We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This works fine:
local canvas = document:createElement('canvas') canvas.width = 400 canvas.height = 400 function canvas:onclick(event) print(event.offsetX, event.offsetY) end document.body:appendChild(canvas)
but this prints nil for the values in event:
nil
event
local canvas = document:createElement('canvas') canvas.width = 400 canvas.height = 400 canvas:addEventListener('click', function (event) print(event.offsetX, event.offsetY) end) document.body:appendChild(canvas)
the event is passed correctly, as it's printed as [object HTMLCanvasEvent].
[object HTMLCanvasEvent]
The same restriction prevents me from accessing for example the timestamp passed into a requestAnimationFrame callback.
requestAnimationFrame
Given that I know the type of the JS object there, isn't there a way I can at least extract the properties?
The text was updated successfully, but these errors were encountered:
The first argument to your callback is this. The second argument is the event object.
this
Sorry, something went wrong.
welp, you're right 😄 I could swear I was printing the number but couldn't use it in the second case but seems like this is on me...
Going to close this, but while I'm here: is there a way I can extend an ES6 class defined in JS with Lua?
You can do it manually, but a helper might be nice. That's tracked in #29
No branches or pull requests
This works fine:
but this prints
nil
for the values inevent
:the event is passed correctly, as it's printed as
[object HTMLCanvasEvent]
.The same restriction prevents me from accessing for example the timestamp passed into a
requestAnimationFrame
callback.Given that I know the type of the JS object there, isn't there a way I can at least extract the properties?
The text was updated successfully, but these errors were encountered: