【发布时间】:2017-03-06 01:34:21
【问题描述】:
我希望使用 pygame 在屏幕上绘制几个大半径的圆。我想定义一个名为surface1 的表面大于我的显示表面(screen),并在实际尺寸中绘制我的圆圈。一旦我这样做了,我计划重新调整surface1 并将其显示在screen 上。这是我的代码:
import pygame
pygame.init()
live = True
while live:
surface1 = pygame.Surface((7680, 4320))
screen = pygame.display.set_mode((1280, 720))
# pygame.display.flip()
surface1.fill((255, 255, 255))
pygame.draw.circle(surface1, (0, 0, 0), (3839, 2160), 4500, 10)
surface1 = pygame.transform.scale(surface1, (1280, 720))
surface1.convert()
screen.blit(surface1, (0, 0))
pygame.display.update()
for event in pygame.event.get():
if event.type == pygame.QUIT:
live = False
由于某种原因,我看不到圆圈。但是,显示窗口的颜色会根据我在surface1 中设置的内容而变化。为什么会这样?任何帮助,将不胜感激。提前致谢。
【问题讨论】:
标签: python-2.7 pygame geometry pygame-surface