Class: UIHealthBar

UIHealthBar(sprite, position, size, buffer) → {UIHealthBar}

new UIHealthBar(sprite, position, size, buffer) → {UIHealthBar}

A health bar to can be used for UI's
Parameters:
Name Type Description
sprite texture Texture for the UIHealthBar
position Array.<Array> Base position for the UIHealthBar
size Array.<Array> The size for the UIHealthBar
buffer int Size different between background and foreground
Source:
Returns:
Type
UIHealthBar

Methods

draw(aCamera)

Draws the UIHealthBar
Parameters:
Name Type Description
aCamera Camera The camera to draw it on
Source:

getCurrentHP() → {int}

Get the Current HP
Source:
Returns:
The Current HP
Type
int

getMaxHP() → {int}

Get the Max HP
Source:
Returns:
The Max HP
Type
int

incCurrentHP(hp)

Increment the HP by the passed amount
Parameters:
Name Type Description
hp type The amount to increment by
Source:

setCurrentHP(hp)

Set the Current HP
Parameters:
Name Type Description
hp type what to set the Current HP
Source:

setMaxHP(hp)

Set the Max HP
Parameters:
Name Type Description
hp int What to set the Max HP to
Source:

update()

Update the UIHealthBar
Source: