Last active
February 27, 2019 19:14
Pygame Practice -03 Images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background image (src: opengameart.org)