-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
Add example for retro scaling #2785
Conversation
Add file "retro_scaling.py" that shows how to render to a surface and scale it to achieve a retro look.
Fixed spelling in comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, thanks for contributing! 🥳
We use black
for keeping our code formatted, please run python3 setup.py format
and commit the resulting changes.
Hmm. As is, this duplicates existing functionality, but it could be useful as a "Rosetta Stone" if we add another example based on Window and Texture, to show how one would to this with SDL2 machinery. |
I thought I did. I will try again. |
Are you referring to pygame.SCALED? |
Second try formatting.
Third try. Re-uploading the file.
Fourth try. Re-uploading file.
Yeah, if you're up for it. As is, there are many use cases deliberately not covered by SCALED, and rather than having people poke around in the innards of the display module like @Matiiss likes to do (which could break at any time with the next release), it would make more sense to implement SCALED on top of pygame.Window. Maybe somebody wants to have the background a repeating pattern instead of black, or a nine-patch pattern, or just a different colour. Maybe somebody wants to use SCALED but really, really wants to control the size of the window. Something like that is probably within your abilities (you already did it once) and could be really useful. |
I have no idea how that would be done. I don't have the skills. But my code here https://github.com/snowfruit/pygame-addons/tree/main/pygame-screen might spark some ideas for a person who knows how. |
I did the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the PR 🎉
I think we could potentially expand this in the future to maybe become more interactive, or integrate it into a bigger example. For now I don't mind merging this change in its current state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add file "retro_scaling.py" that shows how to render to a surface and scale it to achieve a retro look.