sprite animation; incomplete sizes and assumptions
Order issue
When creating sprite animations, it uses the sprite.texture property, which can make some assumptions if the order is not correct i.e calling add_from_json or similar before sprite.add( anim ), it will try and reference the sprite and crash.
When using different sized textures with different animations on UV animated sprites
The second issue I noticed was trying to set animations using separate textures. One had a frame size of 20 wide, and the other 32 wide. When changing animations, the frame size remained at 20, squashing the second animation.
And finally, in the same test case, creating the animations with different textures, is the first texture size is used. If the sizes differ the uv's on the second frameset are bogus.
Either the frame can be handed the texture object directly, or frame sizes should be worked out when the sprite is refreshed (in sprite anim component).
- [x] sprite references guarded
- [ ] animation frame size respected
- [ ] sizes accounted for