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()

猜你喜欢

转载自www.cnblogs.com/xiyu714/p/9031393.html
今日推荐