Learn Before
Code
Using Surface.blit() in Pygame
You can use pygame.Surface.blit() to draw one surface onto another at a given location. Blit() takes in a source Surface (what you're drawing from), a destination position (where on the surface you're drawing), an optional set of coordinates for the area of the Surface you're drawing from, and an optional set of flags to modify the result.
displaySurface = pygame.display.set_mode(1920, 1080) image = pygame.image.load("cat.png") displaySurface.blit(image, (100, 100)) #this will copy the image onto the displaySurface at the position (100, 100)
0
1
Updated 2021-07-19
Tags
Python Programming Language
Data Science