在以下代码中,在任何给定时间点屏幕上不仅有一个圆。 我想解决这个问题,使它看起来像只有一个圆圈,而不是留下任何鼠标光标所在的污迹。如何摆脱pygame表面?
import pygame,sys
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((640,400),0,32)
radius = 25
circle = pygame.Surface([radius*2]*2,SRCALPHA,32)
circle = circle.convert_alpha()
pygame.draw.circle(circle,(25,46,100),[radius]*2,radius)
while True:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
screen.blit(circle,(pygame.mouse.get_pos()[0],100))
pygame.display.update()
pygame.time.delay(10)
此方法的工作原理是有效的,但有没有更多的面向对象的方法?我打算让这个类对象,所以我想知道是否有另一种方式,不使用screen.fill(bgColor)。 – lotsofsloths 2010-02-07 00:13:22