pygame ajoute photo code example
Example 1: draw image pygame
import pygame as pg
pg.init()
screen = pg.display.set_mode((display_width,display_height))
yourImg = pg.image.load('yourImg.png')
def showImg(x,y):
screen.blit(yourImg, (x,y))
done = False
while not done:
for event in pg.event.get():
if event.type == pg.QUIT:
pg.quit()
quit()
showImg(10,10)
pg.display.update()
pg.quit()
quit()
Example 2: pygame flip image
image = pygame.image.load('image.png')
flipped = pygame.transform.flip(image, True, False)