[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Questions about surface with alpha channel
Hi,
Thanks for your answer.
But can you pass an RGBA value to the fill method? In the document it
says RGB I think.
Best Regards
/John
ons 2007-06-20 klockan 22:14 -0700 skrev Peter Shinners:
> 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.
>
> > 2. How do you clear an alpha channel surface? I guesss you can't use the
> > fill method?
>
> Fill is really the only way to do it. Fill will set all the pixels in an
> image to a given value. You can set the alpha channel to invisible (0) or
> solid (255).
>