I want to load a specific part of an image in pygame. How do I do it? I have an image of a character in different angles. In SDL we use a rect, but do we have this option in pygame?
Asked
Active
Viewed 190 times
0
-
Possible duplicate of [How can I crop an image with Pygame?](https://stackoverflow.com/questions/6239769/how-can-i-crop-an-image-with-pygame) – skrx Jun 14 '18 at 14:55
-
You can also use the [`pygame.Surface.subsurface`](https://www.pygame.org/docs/ref/surface.html#pygame.Surface.subsurface) method, but have to make sure that the rect is inside of the image area. – skrx Jun 14 '18 at 14:57
1 Answers
0
https://www.pygame.org/docs/ref/surface.html#pygame.Surface.blit use the surface.blit(source, dest, area=None, special_flags = 0)). the area argument will allow you to put a rect of what part of the image that you want to draw