-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
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
Scale window? #96
Comments
This is currently doable (take a look at the platformer example, or the raycaster community example). The way you do it is you create a canvas that has the correct dimensions and then scale it to fit the window. Resizing is possible too, all you need to do is to resize the canvas according to the size of the window. But, I guess I'd be willing to accept this feature into |
You can do this as a last operation on all matrices for drawing:
I have a constant set for vWidth and vHeight so I dont need to pass that argument, which makes it a bit more convenient. This will however not take care of clearing the black boxes surrounding the content so you have to redraw the entire screen. I dont know if it makes sense to include this operation on the |
Loving Pixel so far, but one bit of convenience for pixel-art games could be a means to scale the window output.
For example, if I have a game running at 256x224 (SNES resolution) I could display double-size by calling something like
window.SetScale(2.0)
. It would render at 256x224, but increase the window size to 512x448 and scale the output to match.Currently this can be done with some camera scale trickery, but the math gets complicated and it doesn't allow the window to be resized on the fly.
The text was updated successfully, but these errors were encountered: