Constructor
new Aseprite($textureColor, $data)
- Description:
- Creates a new Aseprite module manager.
- Source:
Example
const aseprite = new Aseprite(textureColor, data);
aseprite.getSprites(tag);
Parameters:
Name |
Type |
Description |
$textureColor |
string
|
The color texture source. |
$data |
typeaseprite.<T>
|
The Aseprite JSON file. |
Members
textureColor :string
- Description:
- Gets the color texture source.
- Source:
Gets the color texture source.
Type:
Methods
getSprites($tag) → {Map.<Sprite, number>}
- Description:
- Gets the sprites and their duration for the given tag.
- Source:
Parameters:
Name |
Type |
Description |
$tag |
T
|
The given tag. |
Returns:
-
Type
-
Map.<Sprite, number>
Type Definitions
typeaseprite
- Description:
- Source:
Properties:
Name |
Type |
Description |
typeaseprite.frames |
Array.<typeasepriteframe>
|
The Aseprite JSON frames data. |
typeaseprite.meta |
typeasepritemeta.<T>
|
The Aseprite JSON meta data. |
An Aseprite JSON data.
Type:
typeasepriteframe
- Description:
- An Aseprite JSON frame data.
- Source:
Properties:
Name |
Type |
Description |
typeasepriteframe.duration |
number
|
The duration. |
typeasepriteframe.filename |
string
|
The file name. |
typeasepriteframe.frame |
Object
|
The frame.
Properties
Name |
Type |
Description |
x |
number
|
The x position of the frame. |
y |
number
|
The y position of the frame. |
w |
number
|
The width of the frame. |
h |
number
|
The height of the frame. |
|
typeasepriteframe.rotated |
boolean
|
The rotated status. |
typeasepriteframe.spriteSourceSize |
Object
|
The sprite source size.
Properties
Name |
Type |
Description |
x |
number
|
The x position of the sprite source. |
y |
number
|
The y position of the sprite source. |
w |
number
|
The width of the sprite source. |
h |
number
|
The height of the sprite source. |
|
typeasepriteframe.sourceSize |
Object
|
The sprite size.
Properties
Name |
Type |
Description |
w |
number
|
The width of the source. |
h |
number
|
The height of the source. |
|
typeasepriteframe.trimmed |
boolean
|
The trimmed status. |
An Aseprite JSON frame data.
Type:
- Description:
- An Aseprite JSON tag meta data.
- Source:
Properties:
Name |
Type |
Description |
typeasepriteframetag.name |
T
|
The name. |
typeasepriteframetag.from |
number
|
The first frame. |
typeasepriteframetag.to |
number
|
The last frame. |
typeasepriteframetag.direction |
string
|
The animation direction. |
typeasepriteframetag.color |
string
|
The color. |
An Aseprite JSON tag meta data.
Type:
- Description:
- An Aseprite JSON meta data.
- Source:
Properties:
Name |
Type |
Description |
typeasepritemeta.app |
string
|
The app meta data. |
typeasepritemeta.format |
string
|
The format meta data. |
typeasepritemeta.image |
string
|
The image meta data. |
typeasepritemeta.scale |
string
|
The scale meta data. |
typeasepritemeta.size |
Object
|
The size meta data.
Properties
Name |
Type |
Description |
w |
number
|
The size width meta data. |
h |
number
|
The size height meta data. |
|
typeasepritemeta.version |
string
|
The version meta data. |
typeasepritemeta.frameTags |
Array.<typeasepriteframetag.<T>>
|
The Aseprite JSON tags meta data. |
An Aseprite JSON meta data.
Type: