Get the absolute x value
Returns:
Type | Description |
---|
number | The absolute x value |
Get the absolute y value
Returns:
Type | Description |
---|
number | The absolute y value |
Create the cell sprites of the animation
createScreenFlashSprite()
Create the screen flash sprite of the animation
currentFrameIndex()number
Get the current animation frame's index
Returns:
Type | Description |
---|
number | The index of the current frame |
Destroys the sprite
Gets the blend color for the sprite
Returns:
Type | Description |
---|
array | The blend color [r, g, b, a] |
Gets the color tone for the sprite
Returns:
Type | Description |
---|
array | The color tone [r, g, b, gray] |
Makes the sprite "hidden" (not visible)
Initialize sprite variables
Initializes the sprite
Name | Type | Description |
---|
bitmap | Bitmap | The bitmap of the sprite |
Check if the animation is playing
Returns:
Type | Description |
---|
boolean | True if the animation is playing |
Check if the animation is ready to play
Returns:
Type | Description |
---|
boolean | True if the animation is ready to play |
Loads the bitmaps for the animation
Sets the x and y coordiantes of the sprite
Name | Type | Description |
---|
x | number | The x coordinate of the sprite |
y | number | The y coordinate of the sprite |
Handling for when the animation ends
processTimingData(timing)
Processes timing data
Name | Type | Description |
---|
timing | Object | Timing data object |
Sets the blend color for the sprite
Name | Type | Description |
---|
color | array | The blend color [r, g, b, a] |
Sets the color tone for the sprite
Name | Type | Description |
---|
tone | array | The color tone [r, g, b, gray] |
Sets the rectagle of the bitmap that the sprite displays
Name | Type | Description |
---|
x | number | The x coordinate of the frame |
y | number | The y coordinate of the frame |
width | number | The width of the frame |
height | number | The height of the frame |
Sets the hue rotation value
Name | Type | Description |
---|
hue | number | The hue value (-360, 360) |
setup({Array, animation, mirror, delay)
Set up the animation sprite
Name | Type | Description |
---|
{Array | | targets - The targets of the animation |
animation | Object | The animation object to play |
mirror | boolean | If the animation should mirror |
delay | number | Frame delay for the animation |
Set up the animation duration
Set up the animation rate
Removes the "hidden" state of the sprite, making it visible
startFlash(color, duration)
Starts a flash effect
Name | Type | Description |
---|
color | Array | Array of color data |
duration | number | Duration of the flash in frames |
Starts a hide effect
Name | Type | Description |
---|
duration | number | Duration of the hide in frames |
startScreenFlash(color, duration)
Starts a screen flash effect
Name | Type | Description |
---|
color | Array | Array of color data |
duration | number | Duration of the flash in frames |
Updates the sprite for each frame
updateAllCellSprites(frame)
Updates all cell sprites
Name | Type | Description |
---|
frame | Array | Animation frame data |
updateCellSprite(sprite, cell)
Updates a cell sprite
Name | Type | Description |
---|
sprite | Sprite | The cell sprite to update |
cell | Array | Cell data used to update the sprite |
Update flash effects on targets
Update the animation frame
Update hide effects
Update main elements of animation
Update the animation position
Update flash effects for the screen
Updates the visibility status of the sprite