我想用pygame在屏幕上画几个大半径的圆圈。我想定义一个比我的显示表面(screen)更大的名为surface1的表面,并在实际尺寸中绘制我的圆。一旦我这样做了,我计划重新缩放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中设置的内容而变化。为什么会这样呢?任何帮助都将不胜感激。提前谢谢。
发布于 2017-03-05 11:11:56
圆比大的表面大。pos参数是圆的中心,半径大于宽度和高度的一半。试着画一些小一点的东西。
此外,操纵如此巨大的表面将导致非常差的性能。
https://stackoverflow.com/questions/42602395
复制相似问题