Class: Sprite_Character

Sprite_Character

new Sprite_Character()

The sprite for displaying a character.

Extends

Members

The bitmap for the sprite

blendModenumberinheritedoverrides

The blend mode to be applied to the sprite

heightnumberinherited

The height of the sprite without the scale

opacitynumberinheritedoverrides

The opacity of the sprite (0 to 255)

widthnumberinherited

The width of the sprite without the scale

Methods

characterBlockX()number

Get the character's X block from character sheet
Returns:
TypeDescription
numberCharacter X index on a character sheet

characterBlockY()number

Get the character's Y block from character sheet
Returns:
TypeDescription
numberCharacter Y index on a character sheet

characterPatternX()number

Get the character's pattern X value within sheet block
Returns:
TypeDescription
numberCharacter X pattern

characterPatternY()number

Get the character's pattern Y value within sheet block
Returns:
TypeDescription
numberCharacter Y pattern

checkCharacter(character)boolean

Check if the sprite's character is equal to the given character
NameTypeDescription
characterGame_CharacterGame character object to check
Returns:
TypeDescription
booleanTrue if the sprite's character matches

createHalfBodySprites()

Creates the half body sprites
Destroys the sprite

getBlendColor()arrayinherited

Gets the blend color for the sprite
Returns:
TypeDescription
arrayThe blend color [r, g, b, a]

getColorTone()arrayinherited

Gets the color tone for the sprite
Returns:
TypeDescription
arrayThe color tone [r, g, b, gray]
Makes the sprite "hidden" (not visible)
Initialize sprite variables
Initializes the sprite
NameTypeDescription
bitmapBitmapThe bitmap of the sprite

isEmptyCharacter()boolean

Check if the sprite is an empty character
Returns:
TypeDescription
booleanTrue if the sprite is an empty character

isImageChanged()boolean

Check if the Sprite has changed images
Returns:
TypeDescription
booleanTrue if the sprite has changed images

isObjectCharacter()boolean

Check if the sprite is an object character
Returns:
TypeDescription
booleanTrue if the character is an object character

isTile()boolean

Check if the sprite is a tile
Returns:
TypeDescription
booleanTrue if the character is a tile
Sets the x and y coordiantes of the sprite
NameTypeDescription
xnumberThe x coordinate of the sprite
ynumberThe y coordinate of the sprite

patternHeight()number

Get the character's pattern height
Returns:
TypeDescription
numberHeight of the pattern

patternWidth()number

Get the character's pattern width
Returns:
TypeDescription
numberWidth of the pattern

setBlendColor(color)inherited

Sets the blend color for the sprite
NameTypeDescription
colorarrayThe blend color [r, g, b, a]

setCharacter(character)

Set the character for the sprite
NameTypeDescription
characterGame_CharacterThe game character object to track

setCharacterBitmap()

Sets the bitmap to the character bitmap

setColorTone(tone)inherited

Sets the color tone for the sprite
NameTypeDescription
tonearrayThe color tone [r, g, b, gray]

setFrame(x, y, width, height)inherited

Sets the rectagle of the bitmap that the sprite displays
NameTypeDescription
xnumberThe x coordinate of the frame
ynumberThe y coordinate of the frame
widthnumberThe width of the frame
heightnumberThe height of the frame
Sets the hue rotation value
NameTypeDescription
huenumberThe hue value (-360, 360)
Sets the bitmap to the tileset bitmap
Removes the "hidden" state of the sprite, making it visible

tilesetBitmap(tileId)Bitmap

Get the tileset bitmap given the tile ID
NameTypeDescription
tileIdnumberThe ID of the tile
Returns:
TypeDescription
BitmapThe tileset bitmap
Updates the sprite for each frame
Updates the sprite's bitmap

updateCharacterFrame()

Update the character's frame
Updates the sprite's frame

updateHalfBodySprites()

Updates the half body sprites
Updates other things not already covered by an update function. By default this is opacity, blend mode, bush depth.

updatePosition()

Updates the sprite's position

updateTileFrame()

Updates the tile's frame
Updates the visibility status of the sprite