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.
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
app.apiVersion
is28
- New
app.os
with some properties about the running platform - New
recent
parameter to SaveFile and ExportSpriteSheet commands
app.apiVersion
is27
- Fixed some bugs using tabs widget #4288, #4268
app.apiVersion
is26
- New
Dialog:tab()/endtabs()
widget - New
Dialog:show{ autoscrollbars=true }
parameter - New
app.editor:askPoint{ decorate={ rulers=true, dimmed=true } }
options - New
Align
enum - New
Image.bytesPerPixel
property
app.apiVersion
is25
- Removed
App.events
'beforepaintemptytilemap'
- New
app.window
object. - New integrated
json.decode()
andjson.encode()
functions.
app.apiVersion
is24
- New
Image:flip()
function andFlipType
- New
App.events
:'beforecommand'
,'aftercommand'
,'beforepaintemptytilemap'
app.apiVersion
is23
- New
require()
function - New
app.editor
andEditor
object - New
plugin.name
andplugin.path
properties - New
Cel.zIndex
property - New
Uuid
class - 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
gridBounds
parameter toapp.command.NewLayer
app.apiVersion
is22
- New
app.uiScale
property - 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:repeat
toKeyEvent:repeatCount
- New
ondblclick
event for Dialog:canvas() widget
app.apiVersion
is21
- New
ev
argument 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
app.apiVersion
is20
- Added app.range.slices object
- Only in v1.3-beta21:
- Added
bounds
parameter to app.command.SaveFileCopyAs command - Added
splitGrid
&fromTilesets
parameters to app.command.ExportSpriteSheet command
- Added
app.apiVersion
is19
- Fixed several issues with app.command.SaveFile/SaveFileAs/SaveFileCopyAs commands
- Fixed Sprite:newSlice, now it adds undo information
app.apiVersion
is18
- Now
Dialog()
returnsnil
if we are running in-batch
mode - New
Cel.frame
/Cel.frameNumber
setters - Comparing
Layer
s withSprite
s just return false #3218
app.apiVersion
is17
- New
Color{ index }
- Now
Color.index
returns an integer instead of a number
app.apiVersion
is16
- New
filenamechange
event forSprite.events
- Possibility to change
options
field forDialog:combobox()
fromDialog:modify()
app.apiVersion
is15
- New
onenabled
attribute forplugin:newCommand()
- New
App.events
andSprite.events
properties, andEvents
class - New
Image.bytes
andImage.rowStride
properties - New
WebSocket
class andWebSocketMessageType
constants - New
Layer.isReference
property
app.apiVersion
is14
- Added
selection
argument toapp.useTool{}
to use selection tools - New
SelectionMode
- In v1.3-beta1
- New
Layer.isTilemap
- New
Tileset
- New
app.apiVersion
is13
- New
app.fs.makeDirectory
/app.fs.makeAllDirectories
/app.fs.removeDirectory
functions to manipulate directories - Added
Sprite.pixelRatio
property - Added
app.command.ImportSpriteSheet
.
app.apiVersion
is12
- New
app.command.CanvasSize()
params (ui
andbounds
) - Fixed crash undoing
Sprite:newCel()
in background layer - Fixed
Dialog onclose
event, 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
app.apiVersion
is11
- Added support to modify more properties with
Dialog:modify{}
(PR#2359, separator text #27) - Added some extra
onchange
andonrelease
events for some widgets likeDialog:slider{}
(PR#2359) - Added more arguments (
bgColor
,ink
,button
,opacity
,contiguous
,tolerance
,freehandAlgorithm
) toapp.useTool{}
- New Ink constants
app.apiVersion
is10
- New
Tag.color
property - New
MouseButton
which enumerates possible values for the newev.button
value 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.layers
andRange.frames
setters
app.apiVersion
is9
- New
app.fs
with several functions to handle filenames and paths - New
Dialog{ onclose }
constructor with a table with fields liketitle
andonclose
- New
Dialog:shades{}
widget - New
Image:saveAs{ filename, palette }
function
app.apiVersion
is8
- Fixed
Layer.stackIndex
setter when the number we use is higher than the currentstackIndex
of the layer - Now
app.preferences.document(nil)
returns the default preferences for documents
app.apiVersion
is7
- Added
Sprite.gridBounds
property
app.apiVersion
is6
- Fixed
Sprite:resize()
: Now it can resize the non-active sprite. - Fixed
Sprite:newTag()
: Adds undo information (can be used inside a transaction now).
app.apiVersion
is5
- Added filter commands:
- New types:
- Added support to convert arrays of 2 or 4 integers into points, sizes, and rectangles.
- Added
Range.colors
andRange.containsColor
members. And new commandsCopyColors
/MoveColors
. - Added
Image:resize()
function. - Changed
Sprite:resize()
behavior: resizes the sprite and images (not only the canvas). Sprite.layers
returns only the first level of layers (in previous versions it returned all the layers, even sublayers inside groups).- New
Layer.layers
property to get the layer groups - Possibility to change
Layer.parent
property - New
Layer.stackIndex
property to reorder layers
app.apiVersion
is4
app.useTool()
now can be used inside aapp.transaction()
(#18)- New params for
app.command.NewFile
.
app.apiVersion
is3
app.version
is anVersion
objectSprite
- 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.filename
property
- Added
- New
ColorSpace
class. - New
focus
property for Dialog:button and Dialog:entry. - New parameters for
ExportSpriteSheet
. - New
app.useTool()
,Brush
,Tool
class.
app.apiVersion
is2
- Fixed
app.sprites
table - Added
app.params
table
app
- New
app.apiVersion
with value1
. - Different return value for
app.activeFrame
: Now it returns aFrame
instead of a frame number (an integer value). In v1.2.10-beta2 this function returnednil
when we were in the first frame, now it returns the validFrame
object 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 aFrame
instead of a frame number.
- Different return value for
Rectangle
- Added
Rectangle.contains
function. - Added
Rectangle.intersect
function. - Added
Rectangle.intersects
function. - Added
Rectangle.union
function.
- Added
Sprite
- Added
Sprite.bounds
property. - Different
Sprite:newFrame
andSprite:newEmptyFrame
behavior (check documentation and issue #4).
- Added
Image
- Added
Image:clear()
function. - Added
Image:isEqual
,Image:clear
. - Added
Image:drawPixel
as an alias forImage:putPixel
(both functions will be available). - Deprecated
, replaced withImage:putImage
Image:drawImage
. - Deprecated
, replaced withImage:putSprite
Image:drawSprite
. AlsoImage:putSprite
wasn't working correctly for positions !=0,0
.
- Added
ColorMode
:- Deprecated
, replaced withColorMode.GRAYSCALE
ColorMode.GRAY
.
- Deprecated
Tag
:- Different return value for
Tag.fromFrame
andTag.toFrame
: now they return aFrame
object 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.
app
app.apiVersion
didn't exist (isnil
)