pixi-react
pixi-react copied to clipboard
Ensure if AnimatedSprite is playing and textures are switched it continues to play
Original Issue: https://github.com/pixijs/pixi-react/issues/359 See also: https://github.com/orgs/pixijs/projects/6/views/1?pane=issue&itemId=18775677
Stopping after texture change is actually the functionality straight from PIXI: https://github.com/pixijs/pixijs/blob/dev/packages/sprite-animated/src/AnimatedSprite.ts#L389
I'm wary of making changes which diverge from how PIXI itself works, but this poses a challenge as it means the React state of isPlaying becomes out of sync with AnimatedSprite's internal state. A callback onPlayingChanged may be the best solution although I appreciate it also isn't optimal.