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

Re: [pygame] Problem: difference in surface alpha from pygame 1.7 and 1.8



On Sun, Dec 14, 2008 at 12:49 PM, Luca <lucafbb@xxxxxxxxx> wrote:
> Hi all.
>
> Some weeks ago I saw that my game has some problem with pygame 1.8 but
> I was using pygame 1.7.
>
> Today I installed 1.8 too and I found the problem.
> In my current approach I draw sometimes transparent surfaces with a fill color:
>
>   surface = pygame.Surface(size, flags=SRCALPHA, depth=32)
>   surface.fill( (150,150,150) )
>   surface.set_alpha( 0 )
>
> Ok, this doens't seems very useful, but I don't want to enter in too
> deep details.
> However this was working on old 1.7.1 version... If I change the alpha
> value later (with surface.set_alpha(100) ), I get a demi-transparent
> surface.
>
> On current 1.8 version the alpha value is ignored If I have a fill
> color... To get a transparency I need to use a RGBA color... but I'm
> almost sure that this wasn't working on pygame 1.7
>
> ...so now I have an incompatibility.
>
> Someone can explain me why this is changed? Why the alpha value of a
> surface is dropped from the fill color?

Fixed removing the SRCALPHA flag from the surface... why this difference?


-- 
-- luca