Skip to content
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

Merged
merged 5 commits into from
Apr 9, 2024

Conversation

snowfruit
Copy link
Contributor

Add file "retro_scaling.py" that shows how to render to a surface and scale it to achieve a retro look.

Add file "retro_scaling.py" that shows how to render to a surface and scale it to achieve a retro look.
@snowfruit snowfruit requested a review from a team as a code owner April 1, 2024 09:34
Fixed spelling in comments.
Copy link
Member

@ankith26 ankith26 left a 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.

@robertpfeiffer
Copy link
Contributor

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.

@snowfruit
Copy link
Contributor Author

Hello, thanks for contributing! 🥳

We use black for keeping our code formatted, please run python3 setup.py format and commit the resulting changes.

I thought I did. I will try again.

@snowfruit
Copy link
Contributor Author

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.

Are you referring to pygame.SCALED?

@robertpfeiffer
Copy link
Contributor

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.

@snowfruit
Copy link
Contributor Author

snowfruit commented Apr 4, 2024

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.
Edited text and link after update.

@snowfruit
Copy link
Contributor Author

Hello, thanks for contributing! 🥳

We use black for keeping our code formatted, please run python3 setup.py format and commit the resulting changes.

I did the python3 setup.py format on the file. I used the web-interface and hope the file is in the right format now. I think the next step is to press the "Re-request review"-button so that's what I will do.

@snowfruit snowfruit requested a review from ankith26 April 4, 2024 17:59
Copy link
Member

@ankith26 ankith26 left a 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.

Copy link
Member

@oddbookworm oddbookworm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@oddbookworm oddbookworm merged commit 8e9eed7 into pygame-community:main Apr 9, 2024
2 checks passed
@ankith26 ankith26 added this to the 2.5.0 milestone Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants