That sounds like an interesting project. What kind of format will your data be in?
The Sprite class does not currently have any public attributes that show the animation details, but it *is* possible to access this information. If you create a Sprite with an animation, it will have a private attribute with the current frame (this attribute will not exist if the sprite uses a static image): >>> sprite = pyglet.sprite.Sprite(img=some_animation) >>> sprite._frame_index 0 As for animation speed: If you're creating an animation from a sequence of images, or a sprite sheet (ImageGrid), you can specify the animation speed on creation. There is not currently a standard way of controlling animation speed after creation, but there are some ways you could to it. The trick is that each frame in an animation has it's own duration attribute. The Sprite class simply plays these frames in order. One way to do it would be to simple re-create the animation and update the sprites *image* attribue with the new animation. Another way would be to iterate through the animations frames, and modify their duration attribute. If you post a little more about what you're trying to accomplish, it would be easier to recommend something. -Ben On Thursday, January 5, 2017 at 7:15:37 PM UTC+9, Solar Lune wrote: > > Hey, there. So, I'm doing work on creating a quick little Python module to > auto-load tags and animations in from Aseprite into pyglet, but before I go > further, I wanted to confirm: Is there no way to control how quickly a > sprite is playing, or know where in the animation a sprite is (apart from > when it hits the end of the animation)? > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/d/optout.
