pygame绘制背景

1 import pygame
2 pygame.init()
3 screen = pygame.display.set_mode((640,480))
4 # ------- background ---------
5 background = pygame.Surface(screen.get_size())
6 background.fill((255, 155, 155))     #fill the background white (red,green,blue)
7 screen.blit(background, (0,0))     #draw background on screen (overwriting all)
8 # --------- flip screen ------------------
9 pygame.display.flip()

 

posted @ 2018-05-13 10:42  夕雨714  阅读(2113)  评论(0编辑  收藏  举报