This is the scripting API for Aseprite. Since Aseprite v1.2.10 you will be able to create scripts with Lua.
You can find some examples for this API or some tests.
Generally you will want to write a script to solve a problem or to do a little experiment, so you have six options to approach your idea:
- Transform the active sprite: In this case
app.sprite will give you access
to the current sprite (it's
nil
if there is no active sprite, e.g. we are in theHome
tab). - Generate a new sprite : Here the Sprite() function creates a new sprite and sets it as the active one. From there you can modify the Sprite object as you want.
- Open one or several existent files: You can use app.open to load a sprite from the disk and then modify it.
- Save the modified sprite: After you have done some modifications to a sprite, you might want to save the result directly to the disk, Sprite:saveCopyAs() function is a good option to export the modified sprite.
- Show a dialog to the user: The Dialog object gives you the possibility to show controls to the user to enter values.
- Add new options to any menu: In this case you'll need to create a plugin with a script.
Globals namespaces
Constants
- Align
- AniDir
- BlendMode
- BrushPattern
- BrushType
- ColorMode
- FilterChannels
- Ink
- MouseButton
- MouseCursor
- RangeType
- SelectionMode
- SpriteSheetDataFormat
- SpriteSheetType
- WebSocketMessageType
Classes/objects
- Brush
- Cel
- Color
- ColorSpace
- Dialog
- Editor
- Events
- Frame
- GraphicsContext
- Image
- ImageSpec
- KeyEvent
- Layer
- MouseEvent
- Palette
- Plugin
- Point
- Range
- Rectangle
- Selection
- Site
- Size
- Slice
- Sprite
- Tag
- Tile
- Tileset
- Timer
- Tool
- TouchEvent
- Version
- Uuid
- WebSocket
- Window
Lua libraries
- Base library and Basic Functions in Lua manual
- Coroutine Manipulation
- String Manipulation
- UTF-8 Support
- Table Manipulation
- Mathematical Functions
- Operating System Facilities
- Some functions like
os.remove
,os.rename
,os.exit
,os.tmpname
are not available yet - Other functions like
os.execute
andio.open
will ask for permissions to the user
- Some functions like
- The Debug Library