Class: Sprite_Battler

Sprite_Battler

new Sprite_Battler(battler)

The superclass of Sprite_Actor and Sprite_Enemy.
NameTypeDescription
battlerGame_BattlerThe battler object

Extends

Members

The bitmap for the sprite

blendModenumberinherited

The blend mode to be applied to the sprite

heightnumberinherited

The height of the sprite without the scale

opacitynumberinherited

The opacity of the sprite (0 to 255)

widthnumberinherited

The width of the sprite without the scale

Methods

checkBattler(battler)boolean

Check if the current battler is the same as the passed battler
NameTypeDescription
battlerGame_BattlerThe battler to check
Returns:
TypeDescription
booleanTrue if the battler matches the current battler

createDamageSprite()

Creates a damage popup sprite

damageOffsetX()number

Get the damage offset x value
Returns:
TypeDescription
numberThe damage offset x value

damageOffsetY()number

Get the damage offset y value
Returns:
TypeDescription
numberThe damage offset y value
Destroys the sprite

destroyDamageSprite(sprite)

Destroy a damage popup sprite
NameTypeDescription
spriteSprite_DamageThe damage sprite to destroy

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)
Check if the touch is within the sprite
NameTypeDescription
xnumberThe x coordinate of the touch
ynumberThe y coordinate of the touch
Returns:
TypeDescription
booleanTrue if the x and y coordinates are inside the sprite

inHomePosition()boolean

Check if the sprite is in its home position
Returns:
TypeDescription
booleanTrue if the sprite is in its home position
Initialize sprite variables
Initializes the sprite
NameTypeDescription
bitmapBitmapThe bitmap of the sprite

isBeingTouched()booleaninherited

Check if the sprite is being touched
Returns:
TypeDescription
booleanTrue if the sprite is touched

isClickEnabled()booleaninherited

Check if the sprite is clickable
Returns:
TypeDescription
booleanTrue if the sprite is clickable

isEffecting()boolean

Check if the sprite is effecting
Returns:
TypeDescription
booleanTrue if effecting. By default this will always return false when called from Sprite_Battler

isMoving()boolean

Check if the sprite is moving
Returns:
TypeDescription
booleanTrue if moving.
Check if the sprite is pressed
Returns:
TypeDescription
booleanTrue if the sprite is pressed
Get the main battler sprite
Returns:
TypeDescription
Sprite_BattlerThe main battler sprite
Sets the x and y coordiantes of the sprite
NameTypeDescription
xnumberThe x coordinate of the sprite
ynumberThe y coordinate of the sprite
Processing when the sprite is clicked
Processing when the mouse enters the sprite
Handling for when the mouse exits the sprite
Processing for when movement ends
Processing when the sprite is pressed
Processing for touches

setBattler(battler)

Set the battler to a new battler
NameTypeDescription
battlerGame_BattlerThe new battler for the sprite

setBlendColor(color)inherited

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

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
Set the sprite's home
NameTypeDescription
xnumberThe X value for the sprite's home
ynumberThe Y value for the sprite's home
Sets the hue rotation value
NameTypeDescription
huenumberThe hue value (-360, 360)

setupDamagePopup()

Sets up a damage popup sprite
Removes the "hidden" state of the sprite, making it visible

startMove(x, y, duration)

Starts a movement for the sprite
NameTypeDescription
xnumberThe target x offset for the sprite
ynumberThe target y offset for the sprite
durationnumberThe duration of the movement in frames
Updates the sprite for each frame

updateBitmap()

Update the sprite's bitmap

updateDamagePopup()

Update the sprite's damage popups
Update the sprite's frame
Update the main elements of the sprite
Update sprite movement

updatePosition()

Update the sprite's position

updateSelectionEffect()

Update the selection effect for the sprite
Updates the visibility status of the sprite