LuckieLordie Posted February 13, 2014 Share Posted February 13, 2014 I have an animated sprite I use for a number ticker display. When it's not in a group the animation will play perfectly fine. However when the sprite object is added to a group it does not appear to play. However Phaser stores the animation and .isPlaying is set to true. Any workarounds for this problem would be much appreciated! Cheers. Link to comment Share on other sites More sharing options...
rich Posted February 13, 2014 Share Posted February 13, 2014 Up until a few hours ago Groups didn't have a pre/post update hook, so children wouldn't get updated (and animations are part of that process). However I pushed up a new build that added this, so it should be fine now! Link to comment Share on other sites More sharing options...
LuckieLordie Posted February 13, 2014 Author Share Posted February 13, 2014 See Below xD Link to comment Share on other sites More sharing options...
LuckieLordie Posted February 13, 2014 Author Share Posted February 13, 2014 I'm not seeing your commit, the last one was 2 hours ago D: As long as your aware Its fine xD Link to comment Share on other sites More sharing options...
rich Posted February 13, 2014 Share Posted February 13, 2014 It was in this one specifically: https://github.com/photonstorm/phaser/commit/bdb8908fee67d7e4b80cc5ec0f543cfa7569cecd but there have been several commits since. Link to comment Share on other sites More sharing options...
LuckieLordie Posted February 14, 2014 Author Share Posted February 14, 2014 Hey Rich I figured it out! My items were in a group that had their parent as Stage. This meant they still weren't getting a preUpdate. To fix this I got rid of world.preUpdate. and instead gave Phaser.Stage a function for preUpdate that iterated through it's children for a preUpdate. This includes the world because it is a child of Stage. I wasn't sure if this was an ideal solution so I've just detailed it so you can implement it how you like Link to comment Share on other sites More sharing options...
rich Posted February 14, 2014 Share Posted February 14, 2014 Actually that's a nice idea. I'll implement that now (providing it doesn't conflict with PIXI.Stage). Link to comment Share on other sites More sharing options...
LuckieLordie Posted February 14, 2014 Author Share Posted February 14, 2014 Actually that's a nice idea. I'll implement that now (providing it doesn't conflict with PIXI.Stage). It seems to not cause any issues. But you know more about the inner working than me so :L Link to comment Share on other sites More sharing options...
Recommended Posts