Learn Before
Code
Flipping a Surface in Pygame
You can use transform.flip() to flip a surface vertically, horizontally, or both. You pass in the surface you want to flip, a bool for flipping it horizontally, and a bool for flipping it vertically.
unflippedSurface = pygame.surface(20, 20) flippedSurface = pygame.transform.flip(unflippedSurface, true, false) #flipped horizontally but not vertically
0
1
Updated 2021-08-09
Tags
Python Programming Language
Data Science