Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] Loading a image
#1
I know this should be a simple one but when I run my code I get a blank screen before my game starts, the blank screen should load a loading screen I created in paint. This is saved in the same folder as my game and this title_page() is called after pygame is initialized. width and height are already defined variables that are the height and width of the pygame window. Can I please have some help loading in this image, pygame and time are already imported.

def title_page(width, height):
    screen = pygame.display.set_mode((width, height))
    title_screen = pygame.image.load('4 in a row.png')
    screen.blit(title_screen,(100,100))
    time.sleep(5)
Thanks for the help.
Reply


Messages In This Thread
Loading a image - by Help_me_Please - Aug-20-2019, 10:26 AM
RE: Loading a image - by Windspar - Aug-20-2019, 10:33 AM
RE: Loading a image - by Help_me_Please - Aug-20-2019, 10:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] pygame image loading error BlueClaw 6 6,415 Dec-10-2019, 08:50 PM
Last Post: BlueClaw

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020