Spritesheet with different frame size #2055
Replies: 2 comments 3 replies
-
The sprite sheet only defines the frames, and has nothing to do with displaying them. Check the code related to displaying the animation already has support for this, and if not, override the functionality to display the frames based on their center point. You would have to ensure that all the frames listed in the sprite sheet are centered at a common point. If you are generating the sprite sheet using a tool that strips the transparent regions, then it is unlikely that frames are centered correctly. The animation is usually handled by the |
Beta Was this translation helpful? Give feedback.
-
Set the AnchorPoint( 0.5 ,0.5 ); if your having trouble with you can try my Remap function. float MapTo( float x, float in_min, float in_max, float out_min, float out_max ) {
float anchorX = MapTo( SpriteWidth / 2 , 0.0 , SpriteWidth , 0.0 , 1.0 ); I Use it to offset sprites with box2d when I set I want to rotate from a different point and scale. |
Beta Was this translation helpful? Give feedback.
-
Hi,
How can i load a .plist spritesheet but with frames with different size and centralize all of they? Example:
They have different size but i need show it in some place with all frames centralized and not "dancing".
Thanks for any help.
Beta Was this translation helpful? Give feedback.
All reactions