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

Sprite scale clamping #28

Closed
quarrel opened this issue Jul 21, 2018 · 3 comments
Closed

Sprite scale clamping #28

quarrel opened this issue Jul 21, 2018 · 3 comments

Comments

@quarrel
Copy link

quarrel commented Jul 21, 2018

It would be great to have a way to limit sprite scaling. At the moment I have situations where I want to zoom out, and it all works very well except that sprites get very small. If I could just clamp the maximum scale for the sprite scaling that would great. Similarly zooming in a lot.

Unfortunately it seems like the scaling is applied to the final surface, so it would be a bit of an overhaul to change it.

However, it does strike me that there is an opportunity, in that the scaling of map tiles shouldn't be repeatedly happening anyway?

Even thoughts on achieving this. Thanks for pyscroll :)

@bitcraft
Copy link
Owner

bitcraft commented Jul 23, 2018

You're correct, scaling is done after sprites and map are rendered. If you want to manage the size of the sprites, then you will have to scale them separately before passing them to pyscroll. Perhaps when when zoom is beyond a certain value, scale all your sprites from the original images to a larger size first.

However, it does strike me that there is an opportunity, in that the scaling of map tiles shouldn't be repeatedly happening anyway?

No opportunity here. Map tiles are never scaled, even with zoom operations; only the final output is scaled. I've done a lot of benchmarks, and the way pyscroll exists now is a compromise of a lot of use cases. Its not as slow as it would seem. Changing the zoom operation would complicate it and possibly make other operations worse. Pre-scaling tiles does lead to better performance depending on the zoom level, but it adds a lot of complexity.

@quarrel
Copy link
Author

quarrel commented Jul 23, 2018

Fair enough. Thanks very much for the feedback, ideas and the consideration.

@quarrel quarrel closed this as completed Jul 23, 2018
@bitcraft
Copy link
Owner

If you don't mind @quarrel I'd love to see the progress on the game, if you don't mind sharing. My goal with pyscroll is to make pygame easier for people to use pygame, and I like seeing whats possible with it. Your project sounds interesting.

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

No branches or pull requests

2 participants