|
Re: fade out surfaces: msg#00160python.pygame
Even though I believe I have pygame running at depth 32, I get the following error: alpha = pygame.surfarray.pixels_alpha(surf) ValueError: unsupport colormasks for alpha reference array Luke On 12/09/05, Willem <willemsh-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote: > Pete Shinners wrote: > > On Sun, 2005-09-11 at 10:05 +1000, Luke Miller wrote: > > > >>Well, I might have a look at it in a few days (surfarray). It's really > >>just one of those luxury extras... > > > > > > The surfarray code for this would not be complicated. Off the top of my > > head, this should do the job > > > > def multiply_alpha(surf, value): > > """Multiple the pixel alphas. Value range is 0 - 255.""" > > alpha = pygame.surfarray.pixels_alpha(surf) > > multAlpha = alpha * value > > multAlpha >>= 8 > > alpha[:] = multAlpha.astype(Numeric.UInt8) > > > > > > > Thanks a lot, although i'm not really sure how it does what it does, it > works great! My app won't be as great as others but it'll be free and I > think it'll fill some space better than others are doing, at least until > some nice hacker thinks he can do better and does something pro for real. > |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Double Buffered display vs Overlays: 00160, Dmitry Borisov |
|---|---|
| Next by Date: | Please explain what I've done wro: 00160, Roel Smulders |
| Previous by Thread: | Re: fade out surfacesi: 00160, Willem |
| Next by Thread: | Re: fade out surfaces: 00160, Peter Shinners |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |