FnF-Spritesheet-and-XML-Maker icon indicating copy to clipboard operation
FnF-Spritesheet-and-XML-Maker copied to clipboard

If Image Optimization/Clipping is enabled, frame should be recalculated to create the original image.

Open EliteMasterEric opened this issue 2 years ago • 2 comments

This is the original intent of the frame attributes, and what Haxe is optimized for.

Say I have a 100x100 image, that contains 80x80 of content with 10px of empty space around it.

A subtexture with a width of 80, a height of 80, a frameX of 10, frameY of 10, a frameWidth of 100, and a frameHeight of 100 will render identically to the original image, while taking up less space in the spritesheet and thus in memory.

The current clipping implementation messes discards the frame information and sets x/y to 0 and w/h to that of the new image. This means that some frames of the animation will be offset from what is expected.

EliteMasterEric avatar Nov 03 '21 07:11 EliteMasterEric