Importing Different Spritesheet Files as One

I want to learn how to import sprite sheets. I know a similar topic exists; however, I cannot use tile source since my animations exists as separate spritesheet files. How can I import them as one file?

1 Like

Can you elaborate what you mean by spritesheet files? Do you mean load an image during runtime and turn that into an atlas/tile source? I think one of the best things for you to do is just merge the images and make one tile source with that one image.

Sure. I have different animations of my character as different files. For instance, run cycle is one sprite sheet and idle cycle is another sprite sheet. Cannot use tile source since it is too much work to dynamically change sources. Also most of my characters are created that way so merging all would take too much time. What can ı do.

Typically with Defold you have to split your spritesheets, so that each image file is one frame of an animation. And this is the best way to do it, since the build process can then optimally pack and reuse your textures and achieve the smallest possible bundle size. So I suspect Defold doesn’t support spritesheets on purpose, because it would be enabling a bad practice.

You can split them quite easily using ImageMagick or another similar tool. It’s usually just one command like magick convert spritesheet.png -crop 32x32 frame_%d.png

2 Likes

Thanks for the suggestion, however, I cannot do visual tasks like sprite sheets in a command-line tool, can you suggest me an visual app that can also split with spacing and offset in mind?

Assuming they’re evenly spaced on the sheet (rows and columns of equally-sized frames), then ImageMagick should be able to do it pretty easily. To do it with a GUI I guess the import function of LibreSprite should be able to do it. Or even better go straight for Aseprite if you want to either pay for it or compile it yourself from source.

(LibreSprite is a somewhat outdated but free fork of Aseprite from the last commit when the latter had a GPLv2 license.)

Krita has a tool that allows you to split.images, though I don’t remember if you can account for offset and stuff ,but you probably can.