I just struggled with something similar to this as well.  I'm doing
pixel perfect collisions with a black and white collision map which
has the same coordinates as my overlay image.  Surfarray in pygame
made this really easy to do since you could specify the x and y
coordinates of a pixel and get a tupple value back of the RGB values.
I ended up changing the code to change the format to just return the
value for 'R' and then wrote a function for determining the x/y index
value for a given pixel.  It'd be nice if pyglet could do this for you
though.

Another annoying problem was the data member returned each individual
pixel value back as a string which looks like '\x00' or '\xff'.  It'd
be nice if these were integers instead.

--Patrick.


On Dec 21, 2007 11:43 AM, Andrew Straw <[EMAIL PROTECTED]> wrote:
>
> Andrew Straw wrote:
> > I gather you're implying that I can use a string view of the numpy
> > array's buffer interface... OK, I'll give that a try and write up an
> > example if I succeed.
>
> I succeeded in displaying numpy arrays without copying the data (via a
> slightly different means -- the array's ctypes attribute). I have sent a
> patch, including example code to
> http://code.google.com/p/pyglet/issues/detail?id=202
>
> (I don't know how to change the type of this report to "enhancement"
> rather than "defect".)
>
> I would be happy if you included this in pyglet.
>
> Cheers!
> Andrew
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to