how to load image
i want to load a png-file into my pygame and also a background.
RookiesNCreamN
import pygame
clock = pygame.time.Clock()
from pygame.locals import *
pygame.init()
pygame.display.set_caption('Pygame Window')
Window_Size = (400, 400)
screen = pygame.display.set_mode(Window_Size, 0, 32)
player_image = pygame.image.load('download (1).png')
while True:
screen.blit(player_image, (50, 50)) for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit()
pygame.display.update()
clock.tick(60)
To load the image use
image = pygame.image.load("Julstrumpa.png")
To display it on the screen use
screen.blit(image,(0,0))
inside a loop.