On Tue, May 10, 2011 at 5:51 AM, David Kidd <[email protected]> wrote:

> On Tue, May 10, 2011 at 21:45, Peter Enerccio <[email protected]> wrote:
>
>> Hello
>> one possible, but I am not sure if effective way would be translating
>> the X, Y to the relative X Y of the sprite (ie relative to the sprite
>> not the screen), then getting ImageData out of the sprite and checking
>> the pixel against alpha value. If it is not 255, the sprite was
>> clicked. But this might not be the fastest method.
>>
>
> Is there an example somewhere that shows how to do this? It's not clear to
> me from the documentation how to get the pixel position from
> get_image_data().
>

FYI, here is some code (not by me) that does something very related to that,
which has been mentioned some time ago on this list:

http://swiftcoder.wordpress.com/2008/12/25/pixel-perfect-sprite-collisions/

- Bruce Smith

-- 
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