On 3/4/2010 8:57 PM, Chris wrote:
in python/pyglet how can i reference a GIF file frame (either frames
from an already existing animation OR a grid/sprite sheet i already
made)

pyglet.image.Animation has the instance variable 'frames', a list of AnimationFrame(s). So, if you do

    animation = pyglet.image.load_animation(your_animated_gif_file)

animation is now an instance of Animation. You then can do

    animation.frames[index_of_your_frame] to get the frame.

Check the API docs, the process isn't too different for creating an animation or getting a frame with a sprite sheet.


1. reference an individual frame to display (to include input from the
user such as a keypress) out of a gif file

I'm a little confused by your question -- do you mean when the user presses '1' they get the first frame? I'm not sure what kind of example you need.


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