Trim (crop) alpha for sprites in atlases (DEF-2858)

It sounds quite good on paper but is a little harder to do in a userfriendly way.
Take the running man above as an example. If just trimming everything you don’t control of the center of animation. Unless the legs are equally spread apart (right and left) from the body the animation you will see is gonna be jittery as the body moves back and forth. This assuming that the anchor of the sprite is always in the middle of the sprite image.

So having this feature would need a system of setting anchor points for each image in the atlas as well (or something similar).
Also there are many times where I dont want to trim an image as the empty space is intentional and crucial to me. This means we would need a system to tag which ones that can be trimmed and which not. Any suggestion in how this would be solved in a good user friendly way? ( and that justify the engine work instead of trimming the png’s yourself )

Edit: Ah jumped on the gun a little bit. Storing position of the graphics (or trim info) could be a way to do it.

2 Likes