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.2.22
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
v1.2.19
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
v1.2.18
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
v1.2.17
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
v1.2.16.3
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
v1.2.16
app.apiVersion
is7
- Added
Sprite.gridBounds
property
v1.2.15
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).
v1.2.14
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
v1.2.13
app.apiVersion
is4
app.useTool()
now can be used inside aapp.transaction()
(#18)- New params for
app.command.NewFile
.
v1.2.10
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.
v1.2.10-beta4
app.apiVersion
is2
- Fixed
app.sprites
table - Added
app.params
table
v1.2.10-beta3
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.
v1.2.10-beta2
app
app.apiVersion
didn't exist (isnil
)