pygame blit image code example
Example 1: how to blit image in pygame
def blit_img(img,x,y):
screen.blit(img,[x,y])
Example 2: 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 3: How to make an image in pygame
pygame.image.load('ufo.png')