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

Re: [pygame] fade out surfaces



Hello Peter,

Thanks for all your help on this. It works for me ... kind of!

I call each it frame like thus:

s.alpha -= 5    #or sometimes s.alpha += 5
multiply_alpha(s.image, s.alpha)
draw(s.image)

Except it doesn't seem to work as expected. I think because your
compact code only fades out, not fade in. It does this by shifting the
alpha array to the right?!? I really don't know how your code works!!!
:)  Which really impresses me!

Thanks,
Luke



On 21/09/05, Peter Shinners <pete@xxxxxxxxxxxx> wrote:
> On Sun, 2005-09-18 at 09:33 +1000, Luke Miller wrote:
> > alpha = pygame.surfarray.pixels_alpha(surf)
> > ValueError: unsupport colormasks for alpha reference array
>
> It looks like your Surface uses a colorkey, not perpixel alphas. In that
> case just use Surface.set_alpha(value). No need for a custom function.
>
>
>
>