Skip to content

Instantly share code, notes, and snippets.

@josprachi
Last active February 27, 2019 19:14
Pygame Practice -03 Images
import pygame
from pygame.locals import *
winWidth=600
winHeight=480
color_CYAN=(0,255,255)
pygame.init()
caption="Image Test"
pygame.display.set_caption(caption)
Game_Window=pygame.display.set_mode((winWidth,winHeight))
Game_Window.fill(color_CYAN)
background= pygame.image.load("gameBkg.png")
background=pygame.transform.scale(background,(winWidth,winHeight))
Game_Window.blit(background, (0, 0))
while True:
for event in pygame.event.get():
if event.type==QUIT:
pygame.quit()
exit()
pygame.display.update()
@josprachi
Copy link
Author

gamebkg
Background image (src: opengameart.org)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment