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

Re: [pygame] Pixel alpha blends tutorial




--- "R. Alan Monroe" <amonroe@xxxxxxxxxxxxxxx> wrote:

> 
> > newalpha = pygame.surfarray.pixels_alpha(newcol) #
> > pixels_alpha gives us a ref
> > for n in range(len(newalpha)):
> >     newalpha[n] = alphaarray[n] # and so we simply
> > replace each referenced pixel
> > del newalpha # and then clean up (this unlocks the
> > surface)
> 
> 
> Traceback (most recent call last):
>   File "C:\coding\alphasprite\alphatests.py", line
> 47, in ?
>     newalpha[n] = alphaarray[n] # and so we simply
> replace each referenced pixel
> 
> ValueError: matrices are not aligned for copy
> 
> 
> Alan
> 
> 

Your surface sizes are mismatched.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com