[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



James Paige wrote:
On Mon, Dec 15, 2008 at 09:39:08AM +0100, Luca wrote:
On Mon, Dec 15, 2008 at 12:36 AM, René Dudfield <renesd@xxxxxxxxx> wrote:
hi,

There were some bugs with 1.7.x with some surface arguments.
Thanks for replying, but I found more natural the old 1.7 behaviour...
Now seems that the set_alpha is ignored... It's strange.

I think in 1.7 you were getting a surface with no per-pixel alpha. therefore you could use .set_alpha() to change the alpha for the whole surface.

There were some issues with what a surface defaults too before pygame was initialized and pygame.display.set_mode() called. For 1.8 and about the default is 32 bit with per-pixel alpha. I seem to remember that this change was necessary because what 1.7 did was buggy. And I don't remember per-pixel alpha surfaces using set_alpha() in 1.7.

Now in 1.8 you are getting a surface with per-pixel alpha. That means that .set_alpha() will not work.

I know you can use .convert_alpha() to force a surface to have per-pixel alpha, but I don't know if there is any way to force a surface NOT to have per-pixel alpha.

According to the documents .set_alpha(None) turns off per-pixel alpha. It removes the SRCALPHA flag anyways. This may be new to Pygame 1.9. I don't remember seeing it before.

--
Lenard Lindstrom
<len-l@xxxxxxxxx>