My First Script: Export selected cels limiting sprite size to the cel bounds

First script, first post, also I bought Aseprite like yesterday and I’ve never even touched lua before, so a bunch of firsts right here. I’m making a user interface for my app and I’m drawing all the elements in a single file that is the ideal display size I’m going for, kind of like a mockup and final design in one. Here’s what that looks like:

I found that there was no way to export an individual UI element with its cel bounds. So I wrote this small script that does the trick for me.

Also, if anyone can tell me how to merge cels in a better way then I’ve done without losing information when there’s overlapping transparency for example, I would really appreciate it.

This sort of thing is usually done with Slices, you’d make slices for each UI element and export the slices.

1 Like

This is done with the commandline? I couldn’t find a way in-editor to do this.

Yes, I think the CLI is the only way to export it currently. https://www.aseprite.org/docs/cli/#split-slices

@dacap Is there any chance that CLI-style filename variables like {slice} will eventually be added to the GUI version, to enable using these features without the CLI?