maxrects-packer icon indicating copy to clipboard operation
maxrects-packer copied to clipboard

alphabetical grouping

Open visgotti opened this issue 5 years ago • 3 comments
trafficstars

Wondering if there's a way to do this? don't want to spend time digging into the source code if not needed, but if this isn't possible I'll implement it myself- anything insightful that'll help me implement this if I need to dig in?

visgotti avatar Jul 05 '20 19:07 visgotti

@visgotti Can you describe the meaning of alphabetical grouping? I cannot get it. Currently, you can group your bins by the tag system.

Check this out: https://github.com/soimy/maxrects-packer/blob/0eeb7d14c9402caa5b29e50aecb6c7db368b5b8b/test/maxrects-packer.spec.js#L51-L71

soimy avatar Jul 06 '20 01:07 soimy

so I have sprites.. like walk_frame_1, walk_frame_2 etc. I want these to be binned together, but I also want them one after another in the sprite sheet.

visgotti avatar Jul 08 '20 09:07 visgotti

That's not packer's job, you feed the data with width/height/tag and packer return the bins with position data. Try isolate the filename as the tag, and sort the returning bin data in the program which calling maxrect-packer's API.

soimy avatar Jul 09 '20 06:07 soimy