elringus / sprite-dicing

Cross-engine tool for lossless compression of sprites with identical areas
https://dicing.elringus.me
MIT License
1.35k stars 144 forks source link

Actual Sprite pixel dimensions not being preserved #5

Closed zsculpt closed 4 years ago

zsculpt commented 5 years ago

The sprite dicing algorithm is removing any white space, making fixed-size sprites (32x32, 64x64, etc.) coming out smaller than the really are, which is messing up alignment. For example, if I have a small graphic that animates by moving around the corners of a 32x32 square, the animations just all get cropped to the actual sprite, so it no longer moves around. Does that make sense how I described it? I feel like the dicing algorithm should take into account where it trims the white space and adjusts the pivot point to compensate.

elringus commented 4 years ago

Hey, Sorry for the delay. You can handle such cases by enabling "Keep Original" for pivot when generating the atlas. There is an example for diced sprite animation in the project ("Animation" scene). When the option is enabled, movement is handled correctly.