Closed mnovbaalen closed 4 years ago
Thanks for the report, I'll look into it.
Fixed via c554cdb Should work as you expected now.
Thank you very much @soimy, I'll give it a try!
@soimy I'm very sorry for this late reply, but I can confirm that the fix works for me!
EDIT: I found one thing that is not working correctly yet: In the generated json files, that are now postfixed by an index, the value of the "image" tag in the "meta" tag has the image filename without the index postfix.
@soimy I made this change to atlasify.ts to get things working:
--- src/atlasify.ts (date 1578929561671)
+++ src/atlasify.ts (date 1578929561671)
@@ -329,11 +329,12 @@
// Add tag to the last sheet to control mustache trailing comma
serializedSheet[serializedSheet.length - 1].last = true;
+ const spritesheetId = tagCount[tag];
// prepare spritesheet data
this._spritesheets[index] = {
- id: tagCount[tag],
+ id: spritesheetId,
name: binName,
- imageName: `${binName} .${ext}`,
+ imageName: `${binName}.${spritesheetId}.${ext}`,
imageFormat: "RGBA8888",
width: bin.width,
height: bin.height,
Thanks for the report
Thank you @soimy for fixing this. It is working correctly now.
Atlasify is a great way to generate spritesheets!
However, when there are more images than fit on the spritesheet, Atlasify generates multiple spritesheet files with the same name. This results in having a spritesheet file with only the remainder of images that did not fit on the previous spritesheet(s).
Some info that might help: The problem seems to be in
atlasify.ts
/atlasify.js
, in the pack function. The binName is not unique when no tags are used. Whenis replaced with
then multiple spritesheet files are generated.
This is not a good solution, but just a quick 'see if this helps' hack for my specific use case.
Please fix this in a proper way.