Feedback
- press ENTER to search or ESC to cancel
Table of content
Globals namespaces
Constants
- Align
- AniDir
- BlendMode
- BrushPattern
- BrushType
- ColorMode
- FilterChannels
- FlipType
- Ink
- MouseButton
- MouseCursor
- RangeType
- SelectionMode
- SpriteSheetDataFormat
- SpriteSheetType
- TilemapMode
- TilesetMode
- WebSocketMessageType
Classes/objects
- Brush
- Cel
- Color
- ColorSpace
- Dialog
- Editor
- Events
- Frame
- GraphicsContext
- Grid
- Image
- ImageSpec
- KeyEvent
- Layer
- MouseEvent
- Palette
- Plugin
- Point
- Properties
- Range
- Rectangle
- Selection
- Site
- Size
- Slice
- Sprite
- Tag
- Tile
- Tileset
- Timer
- Tool
- TouchEvent
- Version
- Uuid
- WebSocket
- Window
API Changes
We will try minimize API changes between versions and keep backward compatibility, but if a function in the API was introduced with a bug, it's probable that its behavior will change in the next Aseprite release.
Deprecated should be avoided because might be removed in future versions of Aseprite.
Detect available API
You can use app.apiVersion:
if app.apiVersion == nil then
-- First scripting API available
app.alert("This is Aseprite v1.2.10-beta1 or v1.2.10-beta2")
elseif app.apiVersion == 1 then
-- Second revision of the scripting API
app.alert("This is Aseprite v1.2.10-beta3")
else
-- Future versions will be 2, 3, etc.
end
v1.3.16-beta1
app.apiVersionis36- Added
uiparameter to all commands for enabling/disabling user interaction through their dialogs #3025
v1.3.15.3
app.apiVersionis36- Enclose key names for plugin preferences with
["..."]when it's required #5412
v1.3.15
app.apiVersionis35- Added
sprite.undoHistory#5205 - Added
resizeableproperty toDialogconstructor #5177 - Added
oncheckedparameter to Plugin:newCommand() #5198 - Added missing
FlipType.DIAGONAL#5359 - Added
app.tip#5316 #5348 - Added
autofitandsizeHintproperties to Dialog #5176 - Refresh timeline when changing layer collapsed status #5366
- Process mnemonics consistently for plugins #5250
- Escape characters in the console that we can't show properly #5324
v1.3.14.3
app.apiVersionis34- Added
eventsto listen toblendMode,name,opacityandvisibilitySprite layer changes #5164
v1.3.14
app.apiVersionis33- Added
Dialog:separator()more in line with other widgets #4989 (thanks to @MapleGecko) - Added uuid field to layers #5033
- Added
os.rename()andos.remove()functions - Added
fitCriteriaparameter toapp.command.ChangePixelFormatcommand #4781 - Fixed
cel.image:clear()cannot be undone #5015 - Fixed regression overwriting path specified in
Dialog:file{filename}#5061
v1.3.13
app.apiVersionis32- New
app.clipboardAPI #2073 - New
beforesitechangeevent #4785 - New
plugin.versionandplugin.displayNameproperties #4904 - Don't allow to set invalid pixel ratios for sprites #3285
- Fixed
Image:drawImage()whenBlendMode.SRCis used #5001
v1.3.11
app.apiVersionis31- Fixed
cel.image = nilstatement #4514 - Added
uiparam toapp.command.MaskByColor#2774
v1.3.11-beta1
app.apiVersionis30- Added
GraphicsContextfor images:Image.contextproperty #4330 - Added
ui/flatten/filenameparameters toapp.command.DuplicateSpritecommand #4755
v1.3.10
app.apiVersionis30- Added
app.editor.zoom/scrollproperties #4722 - New option (
Dialog:show{ hand=true }) to enable Hand tool in the active editor with a modal dialog (thanks to @lampysprites)
v1.3.9.2
app.apiVersionis29- New
fgTile/bgTileproperties to get/set the foreground/background tile #4403 - Added
Site.tilemapModeproperty - Added
xandyparams toapp.command.Paste() - Fixed
app.command.Cut/Pastein-batchmode #4354 - Fixed
app.command.Cancel()command when used from scripts - Fixed default
color/bgColorparams inapp.useTool()
v1.3.7
app.apiVersionis28- New
app.oswith some properties about the running platform - New
recentparameter to SaveFile and ExportSpriteSheet commands
v1.3.3
app.apiVersionis27- Fixed some bugs using tabs widget #4288, #4268
v1.3-rc7
app.apiVersionis26- New
Dialog:tab()/endtabs()widget - New
Dialog:show{ autoscrollbars=true }parameter - New
app.editor:askPoint{ decorate={ rulers=true, dimmed=true } }options - New
Alignenum - New
Image.bytesPerPixelproperty
v1.3-rc5
app.apiVersionis25- Removed
App.events'beforepaintemptytilemap' - New
app.windowobject. - New integrated
json.decode()andjson.encode()functions.
v1.3-rc4
app.apiVersionis24- New
Image:flip()function andFlipType - New
App.events:'beforecommand','aftercommand','beforepaintemptytilemap'
v1.3-rc3
app.apiVersionis23- New
require()function - New
app.editorandEditorobject - New
plugin.nameandplugin.pathproperties - New
Cel.zIndexproperty - New
Uuidclass - New
image:clear(bounds, color)variant (we can specify a Rectangle to clear) - New short property names for active objects: app.sprite (same as app.activeSprite), app.layer/frame/cel/tag/tool/brush
- New width/height short names for Rectangle.w/h and Size.w/h
- New
gridBoundsparameter toapp.command.NewLayer
v1.3-rc2
app.apiVersionis22- New
app.uiScaleproperty - New
app.theme:styleMetrics()function - New
plugin:newMenuGroup()andplugin:newMenuSeparator()functions - New
Size:union()function - New GraphicsContext.opacity/blendMode properties
- New GraphicsContext:oval() function
- Renamed
KeyEvent:repeattoKeyEvent:repeatCount - New
ondblclickevent for Dialog:canvas() widget
v1.3-rc1
app.apiVersionis21- New
evargument forSprite.events:on('change', ...)callback to detect if the change is from an undo/redo change (related to #3539) - New AniDir.PING_PONG_REVERSE field
- New Tag.repeats field
- New Sprite.isModified property
- New Image.bounds property and Image:shrinkBounds() function
- New app.theme class
- New Dialog:canvas() widget
- New GraphicsContext class
- New Rectangle.origin and Rectangle.size properties
- New Tile and new Sprite:newTile()
- New Timer class
- New properties field for several objects
v1.2.40 & v1.3-beta21
app.apiVersionis20- Added app.range.slices object
- Only in v1.3-beta21:
- Added
boundsparameter to app.command.SaveFileCopyAs command - Added
splitGrid&fromTilesetsparameters to app.command.ExportSpriteSheet command
- Added
v1.2.36
app.apiVersionis19- Fixed several issues with app.command.SaveFile/SaveFileAs/SaveFileCopyAs commands
- Fixed Sprite:newSlice, now it adds undo information
v1.2.35
app.apiVersionis18- Now
Dialog()returnsnilif we are running in-batchmode - New
Cel.frame/Cel.frameNumbersetters - Comparing
Layers withSprites just return false #3218
v1.2.33
app.apiVersionis17- New
Color{ index } - Now
Color.indexreturns an integer instead of a number
v1.2.31
app.apiVersionis16- New
filenamechangeevent forSprite.events - Possibility to change
optionsfield forDialog:combobox()fromDialog:modify()
v1.2.30
app.apiVersionis15- New
onenabledattribute forplugin:newCommand() - New
App.eventsandSprite.eventsproperties, andEventsclass - New
Image.bytesandImage.rowStrideproperties - New
WebSocketclass andWebSocketMessageTypeconstants - New
Layer.isReferenceproperty
v1.2.28
app.apiVersionis14- Added
selectionargument toapp.useTool{}to use selection tools - New
SelectionMode - In v1.3-beta1
- New
Layer.isTilemap - New
Tileset
- New
v1.2.26
app.apiVersionis13- New
app.fs.makeDirectory/app.fs.makeAllDirectories/app.fs.removeDirectoryfunctions to manipulate directories - Added
Sprite.pixelRatioproperty - Added
app.command.ImportSpriteSheet.
v1.2.22
app.apiVersionis12- New
app.command.CanvasSize()params (uiandbounds) - Fixed crash undoing
Sprite:newCel()in background layer - Fixed
Dialog oncloseevent, now it's called when we close the app and the dialog is still opened #28 - API changes:
- You must use
Dialog:newrow{ always=true }to activate the automatic "newrow" (Dialog:newrow{ always }cannot be used) - You must use
ColorSpace{ sRGB=true }to create an sRGB color space (ColorSpace{ sRGB }cannot be used) - Now
app.command.SetInkType{ type=... }works
- You must use
v1.2.19
app.apiVersionis11- Added support to modify more properties with
Dialog:modify{}(PR#2359, separator text #27) - Added some extra
onchangeandonreleaseevents for some widgets likeDialog:slider{}(PR#2359) - Added more arguments (
bgColor,ink,button,opacity,contiguous,tolerance,freehandAlgorithm) toapp.useTool{} - New Ink constants
v1.2.18
app.apiVersionis10- New
Tag.colorproperty - New
MouseButtonwhich enumerates possible values for the newev.buttonvalue of theDialog:shades{ onclick }widget callback - New
Dialog:modify{}method to change widget properties dynamically - New
Dialog:newrow{ always=true }variant - New
Range:clear()function - New
Range.layersandRange.framessetters
v1.2.17
app.apiVersionis9- New
app.fswith several functions to handle filenames and paths - New
Dialog{ onclose }constructor with a table with fields liketitleandonclose - New
Dialog:shades{}widget - New
Image:saveAs{ filename, palette }function
v1.2.16.3
app.apiVersionis8- Fixed
Layer.stackIndexsetter when the number we use is higher than the currentstackIndexof the layer - Now
app.preferences.document(nil)returns the default preferences for documents
v1.2.16
app.apiVersionis7- Added
Sprite.gridBoundsproperty
v1.2.15
app.apiVersionis6- Fixed
Sprite:resize(): Now it can resize the non-active sprite. - Fixed
Sprite:newTag(): Adds undo information (can be used inside a transaction now).
v1.2.14
app.apiVersionis5- Added filter commands:
- New types:
- Added support to convert arrays of 2 or 4 integers into points, sizes, and rectangles.
- Added
Range.colorsandRange.containsColormembers. And new commandsCopyColors/MoveColors. - Added
Image:resize()function. - Changed
Sprite:resize()behavior: resizes the sprite and images (not only the canvas). Sprite.layersreturns only the first level of layers (in previous versions it returned all the layers, even sublayers inside groups).- New
Layer.layersproperty to get the layer groups - Possibility to change
Layer.parentproperty - New
Layer.stackIndexproperty to reorder layers
v1.2.13
app.apiVersionis4app.useTool()now can be used inside aapp.transaction()(#18)- New params for
app.command.NewFile.
v1.2.10
app.apiVersionis3app.versionis anVersionobjectSprite- Added
sprite:close()function - Added
sprite:assignColorSpace()andsprite:convertColorSpace() - Now
sprite:saveAs()changes the state of the sprite as a saved document - Now you can set
sprite.filenameproperty
- Added
- New
ColorSpaceclass. - New
focusproperty for Dialog:button and Dialog:entry. - New parameters for
ExportSpriteSheet. - New
app.useTool(),Brush,Toolclass.
v1.2.10-beta4
app.apiVersionis2- Fixed
app.spritestable - Added
app.paramstable
v1.2.10-beta3
app- New
app.apiVersionwith value1. - Different return value for
app.activeFrame: Now it returns aFrameinstead of a frame number (an integer value). In v1.2.10-beta2 this function returnednilwhen we were in the first frame, now it returns the validFrameobject withframe.frameNumber = 1. You can access the old frame number value doing:local activeFrameNumber = app.activeFrame.frameNumber - New
app.range
- New
Site- Different return value for
app.site.frame: Now it returns aFrameinstead of a frame number.
- Different return value for
Rectangle- Added
Rectangle.containsfunction. - Added
Rectangle.intersectfunction. - Added
Rectangle.intersectsfunction. - Added
Rectangle.unionfunction.
- Added
Sprite- Added
Sprite.boundsproperty. - Different
Sprite:newFrameandSprite:newEmptyFramebehavior (check documentation and issue #4).
- Added
Image- Added
Image:clear()function. - Added
Image:isEqual,Image:clear. - Added
Image:drawPixelas an alias forImage:putPixel(both functions will be available). - Deprecated
, replaced withImage:putImageImage:drawImage. - Deprecated
, replaced withImage:putSpriteImage:drawSprite. AlsoImage:putSpritewasn't working correctly for positions !=0,0.
- Added
ColorMode:- Deprecated
, replaced withColorMode.GRAYSCALEColorMode.GRAY.
- Deprecated
Tag:- Different return value for
Tag.fromFrameandTag.toFrame: now they return aFrameobject instead of an integer value.
- Different return value for
- All functions that receive an integer can automatically accept
floating numbers doing an implicit
math.floor(number)conversion.
v1.2.10-beta2
appapp.apiVersiondidn't exist (isnil)