Constructor
new Aseprite($texture, $data)
- Description:
- Creates a new Aseprite module manager.
- Source:
Example
const aseprite = new Aseprite(texture, data);
aseprite.getSprites(tag);
Parameters:
Name |
Type |
Description |
$texture |
string
|
The texture source. |
$data |
TypeAseprite.<TypeGeneric>
|
The Aseprite JSON data. |
Members
texture :string
- Description:
- Source:
Gets the 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 |
TypeGeneric
|
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.<TypeGeneric>
|
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 |
TypeGeneric
|
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.<TypeGeneric>>
|
The Aseprite JSON tags meta data. |
An Aseprite JSON meta data.
Type: