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

Re: [pygame] Questions about surface with alpha channel



Peter Shinners wrote:
John Eriksson wrote:
1. Is this the correct way of creating an surface with an
alhpa-per-pixel channel?
surface = pygame.Surface((w, h), pygame.SRCALPHA)

This is the easiest. It will create an 32bit RGBA image for you. If you want more control over the pixel format, you can pass more arguments. But generally not necessary.

Actually this depends on the display settings. So the depth must be given to ensure per-pixel alpha.

surface = pygame.Surface((w, h), pygame.SRCALPHA, 32)

--
Lenard Lindstrom
<len-l@xxxxxxxxx>