Cheetah-Texture-Packer icon indicating copy to clipboard operation
Cheetah-Texture-Packer copied to clipboard

Aligning sprites? [enhancement]

Open pdJeeves opened this issue 7 years ago • 1 comments

I want the sprites to be 4-pixel aligned, so that when it undergoes S3 compression there aren't any blocks of pixels that contain parts of two different sprites, and I can't figure out how to do it. I've already made it extrude the sprites so that they're dimensions are both multiples of 4 (see my fork); thinking that would automatically pack them in an aligned way, which didn't work. Then I tried dividing the size by the alignment at the start of MaxRects::insertNode, and multiplying the resulting position by the alignment before returning, and that didin't work either, so I'm out of ideas.

pdJeeves avatar Dec 30 '17 23:12 pdJeeves

Hello! Possible solution - "virtualize" extrusion of sprites. Means that while packing sprites, algorithm should operate with 4-pixel rounded rectangles, while sprites remain with its own size. I think this method should work, didn't look at source code.

scriptum avatar Jan 26 '18 09:01 scriptum