--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To post to this group, send email to pyglet...@googlegroups.com.
To unsubscribe from this group, send email to pyglet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
i already know how to create an animation from a tileset or spriteset
and seting looping to true or false, what i need is how to change the
image once the punch is finished, my idea is:
class Player(pyglet.sprite.Sprite):
def on_animation_end(self):
if self.image = self.punch_anim:
self.image = self.idle_anim
will that work?
If I can hijack this thread a little:How about using the pyglet.sprite.Sprite.on_animation_end method to set it? Or do you need to change immediately?
I tried the example code, and it works just fine when using two animations. But what if I want the idle pose to just be an AbstractImage? I'm getting this error after the punch animation plays: "AttributeError: 'NoneType' object has no attribute 'frames'". I looked in "sprite.py", and I guess it's happening because _animate() finishes executing even if image isn't an Animation anymore.
self.idle_image = pyglet.image.load(...)
def on_animation_end(self):
if self.image == self.punch_anim:
self.image = self.idle_image
Any way to do this? Thanks!
--
You received this message because you are subscribed to a topic in the Google Groups "pyglet-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyglet-users/nCSoJ2CGbzo/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to pyglet-users...@googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.