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

[pygame] arraydemo.py broken



Hello all!
I have been trying to get arraydemo and numeric to work.
I changed for example scaleup by adding the N.Int32s to it. It then works but I can't get soffen to work at all and have the same problems in my own program. It seems that any operation to the array changes it's type and then it will not work with things like array_blit.

This fails but if I take out the +3 it will work.
def __init__(self, Map_Size):
     map_size=Map_Size
     self.atmosphere_map = zeros((map_size[0], map_size[1],3),Int32) + 3 #all black


#scaleup FIXED
size = N.array(imgarray.shape, N.Int32)*2
scaleup = N.zeros(size, N.Int32)
scaleup[::2,::2] = imgarray
scaleup[1::2,::2] = imgarray
scaleup[:,1::2] = scaleup[:,::2]
surfdemo_show(scaleup, 'scaleup')


Any advice about what is wrong and how to make it work will be wonderful!
Thanks,
--
Douglas E Knapp

http://sf-journey-creations.wikispot.org/Front_Page