You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure this is the proper place to ask, but does anyone have an example of how to best scale a Skia Canvas to match the window size?
For example, say I am making a game with a canvas size 128x128 and a window sized at 512x512 (so 4x), is there an easy way to auto scale (stretch) the canvas to the window size? I don't want to actually create a 512x512 canvas and the draw all the native 128x128 sprite at a larger resolution.
I'm basically after something like the transform: scale(4) you'd get with CSS.
The text was updated successfully, but these errors were encountered:
@nhrones yeah that makes sense but I'm thinking more along the lines of:
canvas.style.transform=`scale(4)`;
Using the context API to scale a 128x128 canvas won't make the canvas fill the 512x512 window. Unless I am misunderstanding something. I'm thinking something along the lines of a window stretch mode that could be fill, etc. Not sure how to achieve that with this lib.
Hopefully that helps clear up my original question.
I'm not sure this is the proper place to ask, but does anyone have an example of how to best scale a Skia Canvas to match the window size?
For example, say I am making a game with a canvas size
128x128
and a window sized at512x512
(so 4x), is there an easy way to auto scale (stretch) the canvas to the window size? I don't want to actually create a512x512
canvas and the draw all the native128x128
sprite at a larger resolution.I'm basically after something like the
transform: scale(4)
you'd get with CSS.The text was updated successfully, but these errors were encountered: