我要做的是给一个变量赋值一个rect,而不在屏幕上绘制它。我在想怎么做。下面是我当前为“myRect”指定一个20x20白色矩形的代码:
import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((50, 50))
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
myRect = pygame.draw.rect(screen, (255, 255, 255), (0, 0, 20, 20))
你用Pygame.Rect游戏公司名称:
参见:https://www.pygame.org/docs/ref/rect.html
如果你想给它加上颜色,你可以扩展Rect类。在
相关问题 更多 >
编程相关推荐