- press ENTER to search or ESC to cancel
Table of content
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
- Properties
- Range
- Rectangle
- Selection
- Site
- Size
- Slice
- Sprite
- Tag
- Tile
- Tileset
- Timer
- Tool
- TouchEvent
- Version
- WebSocket
- Window
Properties
Some objects like a Sprite,
Layer, Cel, Slice,
Tag, Tileset, Tile,
contains some special fields like .color
and .data
to store an
user-defined color or an user-defined text (any text).
Anyway, since Aseprite 1.3-rc1 you can have user-defined and
extension-defined properties for each of these objects. We'll use an
object
in the following examples, as it can be of any kind (Sprite,
Layer, etc.)
User-defined properties
object.properties.myInteger = 1
object.properties.myNumber = 1.2
object.properties.myString = "value"
object.properties.myVector = { 1, 2, 3, ... }
object.properties.myMap = { x=1, y=... }
object.properties = { myInteger=1, myNumber=1.2, ... }
You can set one property at a time, or all properties at the same time. Each time a property is set, it generates undo information.
- The syntax
object.properties = { ... }
sets the user-defined properties, but doesn't modify the properties related to extensions
Extension-defined properties
local pluginKey = "publisher/extension-name"
object.properties(pluginKey).extInteger = 1
object.properties(pluginKey).extString = "value"
object.properties(pluginKey).extVector = { 1, 2, 3, ... }
object.properties(pluginKey).extMap = { x=1, y=... }
object.properties(pluginKey, { extInteger=1, extString=1.2, ... })
Extensions can define their own properties if they need them. Each time a property is set, it generates undo information.
Some important points:
- The given
pluginKey
must be equal topublisher/name
, wherename
is the name of the plugin, andpublisher
the name/ID of the author of this extension (e.g. GitHub username). These values are specified in thepackage.json
file of the plugin - The syntax
object.properties(pluginKey, { ... })
is used to set all the properties related to the extension in the givenobject
- Using a
pluginKey=""
is exactly the same as accessing the user-defined properties