Repository navigation
How to get Actual size of Canvas in onDraw? #3621
radiantone
started this conversation in
General
Replies: 1 comment
|
I think you need Engine.drawWidth // width of game in pixels, respects different displayModes and pixelRatio |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I'm wanting to draw my image (sprite) on my custom Loader during the onDraw callback. It works fine except I can't seem to resize the image based on the current width/height of the <canvas>.
ctx.canvas.widthalways stays the same, but the element width and height is updating when I resize my game window. I'm running in electron btw.I create my Engine like so
All reactions