Classes
Methods
addFrame(pFrameData) → {Frame|undefined}
Adds a new frame to this icon.
Parameters:
Name | Type | Description |
---|---|---|
pFrameData |
Frame
|
Array
|
The frame data to give this frame. |
addState(pIconData) → {Icon|undefined}
Adds this icon data as a state. A state is also an icon.
Parameters:
Name | Type | Description |
---|---|---|
pIconData |
Array
|
The data used to create this state icon. |
export() → {Array}
Exports this icon's data into proper vyi format.
Returns:
- Type:
-
Array
An array of data related to this icon in the proper vyi format.
getDataURL() → {DataURL}
Gets the data URL of this icon.
Returns:
- Type:
-
DataURL
- The base64 data of this image.
getDelay() → {number}
Gets the delay of this icon.
Returns:
- Type:
-
number
The delay of this icon.
getFrame(pIndex) → {Frame|undefined}
Gets the frame existing at pIndex.
Frame 0 will actually be frame "1" in the animation. As this icon will actually be frame 0.
If you are trying to get "frame" 1. Then you will need to use the icon's delay and data url. As that is frame 0.
Parameters:
Name | Type | Description |
---|---|---|
pIndex |
number
|
The index of the frame to get. |
getFrameCount() → {number}
Gets the number of frames this icon has.
Returns:
- Type:
-
number
The amount of frames this icon has.
getFrames() → {Array}
Returns an array of all the frames this icons has.
Returns:
- Type:
-
Array
An array of frames this icon has.
getHeight() → {number}
Gets the height of the icon.
Returns:
- Type:
-
number
The height of the icon.
getId() → {string}
Gets the id of this icon.
Returns:
- Type:
-
string
The id of this icon.
getName() → {string}
Returns the name of this icon.
Returns:
- Type:
-
string
The name of this icon.
getParent() → {Icon|undefined}
Gets the icon this state belongs to. If this icon is not a state, it will return undefined.
getSize() → {Object}
Gets the width and height of this icon and returns it.
Returns:
- Type:
-
Object
An object with the width and height of this icon.
getState(pName) → {Icon}
Gets the state that has the name pName. The LAST defined state that has the passed name will be returned.
Parameters:
Name | Type | Description |
---|---|---|
pName |
string
|
The name of the state to get. |
getStateCount() → {number}
Gets the number of states this icon has.
Returns:
- Type:
-
number
The amount of states this icon has.
getStateNames() → {Array.<string>}
Returns an array of all the state names this icon has.
Returns:
- Type:
-
Array.<string>
An array of the state names.
getStates() → {Array.<Icon>}
Returns an array of all the states this icon has.
getVyi() → {VYI}
Gets the vyi this icon belongs to.
getWidth() → {number}
Gets the width of the icon.
Returns:
- Type:
-
number
The width of the icon.
parse(pIconData)
Parses through the icon data and adds data to this icon.
Parameters:
Name | Type | Description |
---|---|---|
pIconData |
Array
|
The icon data that is used to build this icon. |
removeFrame(pFrame) → {self}
Removes the frame passed.
Parameters:
Name | Type | Description |
---|---|---|
pFrame |
Frame
|
The frame to remove from this icon. |
Returns:
- Type:
-
self
This icon instance.
removeFrameByIndex(pIndex) → {self}
Removes the frame via it's index.
Parameters:
Name | Type | Description |
---|---|---|
pIndex |
number
|
The index of the frame to remove. |
Returns:
- Type:
-
self
This icon instance.
removeState(pState) → {self}
Removes the state passed.
Parameters:
Name | Type | Description |
---|---|---|
pState |
Icon
|
The state to remove from this icon. |
Returns:
- Type:
-
self
This icon instance.
removeStateById(pName) → {self}
Removes the state via it's id.
Parameters:
Name | Type | Description |
---|---|---|
pName |
string
|
The id to use to find the state. |
Returns:
- Type:
-
self
This icon instance.
removeStateByName(pName) → {self}
Removes the state via it's name. The LAST defined icon that has the passed name will be removed. As names are not unique.
Parameters:
Name | Type | Description |
---|---|---|
pName |
string
|
The name to use to find the state. |
Returns:
- Type:
-
self
This icon instance.
rename(pName) → {self}
Changes the name of this icon.
Parameters:
Name | Type | Description |
---|---|---|
pName |
string
|
The new name of the icon. |
Returns:
- Type:
-
self
This icon instance.
reorderFrame(pCurrentIndex, pIndex) → {self}
Reorders the frame in the animation. The index of the passed frame will be swapped with the frame at pIndex.
The "first" frame of the animation is technically this icon's dataURL. So if you are aiming to change the order of this icon and convert it into a frame.
pCurrentIndex must be set to -1 to match this icon.
Parameters:
Name | Type | Description |
---|---|---|
pCurrentIndex |
number
|
The current index of the frame. |
pIndex |
number
|
The index the frame will be moving to. |
Returns:
- Type:
-
self
This icon instance.
setAllFrameDelays(pDelay) → {self}
Sets all the frames belonging to this icon to the same delay.
Parameters:
Name | Type | Description |
---|---|---|
pDelay |
number
|
The delay to set all frames to. |
Returns:
- Type:
-
self
This icon instance.
setDataURL(pDataURL) → {self}
Sets the data url of this icon.
Parameters:
Name | Type | Description |
---|---|---|
pDataURL |
DataURL
|
The base64 data of this image. |
Returns:
- Type:
-
self
This icon instance.
setDelay(pDelay) → {self}
Sets the frame delay of this icon.
Parameters:
Name | Type | Description |
---|---|---|
pDelay |
number
|
The delay to set this frame to. |
Returns:
- Type:
-
self
This icon instance.