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

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



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?

-- 
-- luca