标签:erb screen display div mil spl port mode alpha
1 import pygame
2
3 pygame.init()
4 screen = pygame.display.set_mode((640, 480))
5 # -----设置背景-----
6 background = pygame.Surface(screen.get_size())
7 background.fill((255, 240, 245)) # fill LavenderBlush
8 # ----- 绘制一个圆 -----
9 ballsurface = pygame.Surface((640, 480))
10 ballsurface.set_colorkey((0, 0, 0)) # 将黑色设为色键
11 pygame.draw.circle(ballsurface, (224, 255, 255), (640//2, 480//2), 480//2)
12 # ----- 布局 ------
13 background = background.convert()
14 screen.blit(background, (0, 0))
15
16 ballsurface = ballsurface.convert_alpha()
17 screen.blit(ballsurface, (0, 0))
18 # ----- 显示 -----
19 pygame.display.flip()
标签:erb screen display div mil spl port mode alpha
原文地址:https://www.cnblogs.com/xiyu714/p/9031537.html