com.Components.HealthBar

MovieClip
com.Components.HealthBar
Summary
com.Components.HealthBar
Variables
STATTEXT_PERCENT
STATTEXT_NUMBER
m_Dynel
m_GroupElement
m_Character
m_CurrentStatID
m_MaxStatID
m_Percent
m_Max
m_Current
m_Text
m_Bar
m_AlwaysVisible
m_ShowText
m_TextType
Functions
HealthBar
SetDyneltrace(“healthbar initiated”)
SlotCharacterEntered
SlotCharacterExited
SetBarScalesets the scaling of the bar and repositions the textfield, this will also scale the textfield (uniformly) based on the input
SetGroupElement
SetCharacter
ClearBartrace(“SetCharacter “+character)
SlotStatChangedlistens to a change in stats.
SetMaxgets tha max and sets this as a member used to calculate the percent of health left (0 - 100, used for the _xscale)
SetCurrentUpdates the stat text and bar
UpdateStatTextUpdates the text that overlays the healthbar updates it as percent or real numbers
UpdateStatBar
Hide
Show
SetShowTextshow the text
SetTextTypeHow to display the text, as numbers or percent

Variables

STATTEXT_PERCENT

public static var STATTEXT_PERCENT: Number

STATTEXT_NUMBER

public static var STATTEXT_NUMBER: Number

m_Dynel

private var m_Dynel: Dynel

m_GroupElement

private var m_GroupElement: GroupElement

m_Character

private var m_Character: Character

m_CurrentStatID

private var m_CurrentStatID: Number

m_MaxStatID

private var m_MaxStatID: Number

m_Percent

private var m_Percent: Number

m_Max

private var m_Max: Number

m_Current

private var m_Current: Number

m_Text

private var m_Text: TextField

m_Bar

private var m_Bar: MovieClip

m_AlwaysVisible

private var m_AlwaysVisible: Boolean

m_ShowText

private var m_ShowText: Boolean

m_TextType

private var m_TextType: Number

Functions

HealthBar

public function HealthBar()

SetDynel

public function SetDynel(dynel: Dynel)

trace(“healthbar initiated”)

SlotCharacterEntered

function SlotCharacterEntered()

SlotCharacterExited

function SlotCharacterExited()

SetBarScale

public function SetBarScale(xscale: Number,
yscale: Number,
textScale: Number)

sets the scaling of the bar and repositions the textfield, this will also scale the textfield (uniformly) based on the input

Parameters

xscale:Number - The xscale
yscale:Number - the yscale
scaleText:Number [opt] -the scale of text, if omitted no scaling will occur

SetGroupElement

public function SetGroupElement(groupElement: GroupElement)

SetCharacter

public function SetCharacter(character: Character)

ClearBar

private function ClearBar( )

trace(“SetCharacter “+character)

SlotStatChanged

private function SlotStatChanged(stat: Number,
value: Number)

listens to a change in stats.

Parameters

p_stat:Number - The type of stat, defined in the Stat Enum
p_value:Number - The value of the stat

SetMax

private function SetMax(maxStat: Number,
snap: Boolean) : Void

gets tha max and sets this as a member used to calculate the percent of health left (0 - 100, used for the _xscale)

Parameters

maxStat:String - the max stat as a string

Returns

void

SetCurrent

private function SetCurrent(stat: Number,
snap: Boolean) : Void

Updates the stat text and bar

Parameters

stat:String - the health as a string

Returns

void

UpdateStatText

private function UpdateStatText()

Updates the text that overlays the healthbar updates it as percent or real numbers

UpdateStatBar

private function UpdateStatBar(snap: Boolean)

Hide

public function Hide()

Show

public function Show()

SetShowText

public function SetShowText(showText: Boolean)

show the text

Parameters

showText:Boolean - Show the text or not

SetTextType

public function SetTextType(textType: Number)

How to display the text, as numbers or percent

Parameters

textType:Number - How is the text displayed, using the static HealtBar.STATTEXT_...
public static var STATTEXT_PERCENT: Number
public static var STATTEXT_NUMBER: Number
private var m_Dynel: Dynel
private var m_GroupElement: GroupElement
private var m_Character: Character
private var m_CurrentStatID: Number
private var m_MaxStatID: Number
private var m_Percent: Number
private var m_Max: Number
private var m_Current: Number
private var m_Text: TextField
private var m_Bar: MovieClip
private var m_AlwaysVisible: Boolean
private var m_ShowText: Boolean
private var m_TextType: Number
public function HealthBar()
public function SetDynel(dynel: Dynel)
trace(“healthbar initiated”)
function SlotCharacterEntered()
function SlotCharacterExited()
public function SetBarScale(xscale: Number,
yscale: Number,
textScale: Number)
sets the scaling of the bar and repositions the textfield, this will also scale the textfield (uniformly) based on the input
public function SetGroupElement(groupElement: GroupElement)
public function SetCharacter(character: Character)
private function ClearBar( )
trace(“SetCharacter “+character)
private function SlotStatChanged(stat: Number,
value: Number)
listens to a change in stats.
private function SetMax(maxStat: Number,
snap: Boolean) : Void
gets tha max and sets this as a member used to calculate the percent of health left (0 - 100, used for the _xscale)
private function SetCurrent(stat: Number,
snap: Boolean) : Void
Updates the stat text and bar
private function UpdateStatText()
Updates the text that overlays the healthbar updates it as percent or real numbers
private function UpdateStatBar(snap: Boolean)
public function Hide()
public function Show()
public function SetShowText(showText: Boolean)
show the text
public function SetTextType(textType: Number)
How to display the text, as numbers or percent
Close