Hi! I’m a tiled newbie so my question is probably quite obvious, but I wasn’t able to find the solution on the internet.
I am making my sprites in aseprite, and saving them in both the aseprite format and the sprite sheet format (png + json). The sprites are animated using the layers feature in aseprite.
I would then like to add those sprites to Tiled in such a way that they are animated. So far, the only way I found that makes it possible is to create a separate tileset for each of my animated entities (so for example, a spinning wheel is a single Tiled tilesheet). Then I can set tile spacing and the image with, say, 4 frames, actually gets loaded as 4 separate images. Next, I have to enter the animation editor and add all of the frames separately, set the delay, and apply. Then, finally, I can insert the object into the world.
But I think this procedure is needlessly involved and there must be a quicker way to do this. Ideally, I would like to have one tileset with all my objects, and a way to load the aseprite file (or a PNG) in such a way that it picks up that this is an animation. Is such a thing possible with Tiled? When I add the aseprite file directly to a tileset, only the first frame is picked up. When I load a png tilesheet and set the tile size to the size of a single animation frame, I am again left with just the first frame.
You should be able to at least have all your frames in a single spritesheet, there’s definitely no need to have each frame as its own image. Aseprite has an Export Sprite Sheet feature. Export without any trimming and without packing to make sure the frames all remain the same size and in order. If your animation frames are frames as Aseprite sees them, this should work out of the box. If not and each frame is instead a separate layer, the “Split Layers” option under “Sprite” should work to place the layers as separate “tiles” in the sheet.
If your animations are in different Aseprite documents, you should place them into one prior to export. There are probably Aseprite scripts for this, but you should also be able to copy+paste the layers from multiple documents into one. Or you can stitch several exported sheets into one after export, tools like Atlased can speed this up and help if you need to update the constituent sheets.
As for setting up the actual animation once you’ve imported the tileset: No, Tiled can’t read the animation metadata for you. You can automate the creation of animations in bulk with scripting. This script isn’t meant for animating single tiles, but may still help speed up the process, especially if your individual animations are arranged in the sheet such that each row is a single animation - you can select that entire column and animate it in bulk, and then you’d only need to make small tweaks like removing empty frames from smaller animations. You can write something of your own that automates even more of the process. Aseprite can optionally export an animation metadata file with its spritesheets, you could write something that reads this file and sets up the animations based on it.