Reputation: 1757
I'm currently working on a small game using pygame.
Right now I render images the standard way, by loading them and then blitting them to my main surface. This is great, if I want to work with an individual image size. Yet, I'd like to take in any NxN image and use it at an MxM resolution. Is there a technique for this that doesn't use surfarray and numeric? Something that already exists in pygame? If not, do you think it would be expensive to compute this?
I'd like to stretch the image. So, upscale or downscale the image. Sorry I wasn't clearer.
Upvotes: 0
Views: 167
Reputation: 1967
There is no single command to do this. You will first have to change the size using pygame.transform.scale
, then make a rect of the same size, and set its place, and finally blit. It would probably be wisest to do this in a definition.
Upvotes: 1