[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Re: using alpha for a circle



Ian Mallett wrote:

> You could draw to a surface, then set the alpha value for that image:
> 
> s = pygame.Surface((CircleDiameter,CircleDiameter))
> pygame.draw.circle(s,color
(CircleDiameter/2,CircleDiameter/2),CircleDiameter/2,width)
> s.set_alpha(transparency)
> 
> Ian


hi,
either I made a mistake or it doesn't work with Screen as a Surface
I made:

screen=pygame.display.set_mode(SCREEN_SIZE,pygame.SRCALPHA,32)
pygame.draw.circle(screen,(200,200,255,0.4)
(self.blit_pos[0],self.blit_pos[1]),int(gdata.cans[self.akt][1]))

the gdata is gamespecific, it meens the radius.

Here the circle is drawn solid.