On Fri, Jul 23, 2010 at 1:34 PM, Dorian Lidell <[email protected]> wrote:

> Good evening.
>
> I'm trying to find a way of stopping, pausing and restarting
> pyglet.image.Animation instances. I've checked the documentation and
> the Animation code itself, but I can't find any mention of such
> functionality anywhere.
> I have tried subclassing Animation to implement these features, but
> without any success, as there seems to be no way of determining which
> frame is currently being displayed, and no way of restarting an
> animation once it has stopped due to a frame with duration=None.
>
> If this is possible using standard pyglet classes, please let me know
> how; otherwise, I inquire: what is the proper way to go about
> implementing such a derived Animation class? The actual code offers no
> hint as to how the animation is actually implemented, and I have run
> out of ideas accordingly.
>
> Any help would be greatly appreciated.
>
> D.


I think my class is the closest you can get right now: it supports seeking,
sub-range looping, and pause/resume. Note that it is missing the code to
properly account for variable frame rates.

http://swiftcoder.wordpress.com/2009/04/17/enhanced-animation-code-for-pyglet/

Even if it doesn't suit your needs exactly, it should provide a good
starting point on how to subclass Sprite on your own.

-- 
Tristam MacDonald
http://swiftcoder.wordpress.com/

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