MovieClip |
com.Components.HealthBar |
| com. | |
| 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 | |
| SetDynel | trace(“healthbar initiated”) |
| SlotCharacterEntered | |
| SlotCharacterExited | |
| SetBarScale | sets the scaling of the bar and repositions the textfield, this will also scale the textfield (uniformly) based on the input |
| SetGroupElement | |
| SetCharacter | |
| ClearBar | trace(“SetCharacter “+character) |
| SlotStatChanged | listens to a change in stats. |
| SetMax | gets tha max and sets this as a member used to calculate the percent of health left (0 - 100, used for the _xscale) |
| SetCurrent | Updates the stat text and bar |
| UpdateStatText | Updates the text that overlays the healthbar updates it as percent or real numbers |
| UpdateStatBar | |
| Hide | |
| Show | |
| SetShowText | show the text |
| SetTextType | How to display the text, as numbers or percent |
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
| xscale | :Number - The xscale |
| yscale | :Number - the yscale |
| scaleText | :Number [opt] -the scale of text, if omitted no scaling will occur |
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()
trace(“healthbar initiated”)
public function SetDynel( dynel: Dynel )
function SlotCharacterEntered()
function SlotCharacterExited()
sets the scaling of the bar and repositions the textfield, this will also scale the textfield (uniformly) based on the input
public function SetBarScale( xscale: Number, yscale: Number, textScale: Number )
public function SetGroupElement( groupElement: GroupElement )
public function SetCharacter( character: Character )
trace(“SetCharacter “+character)
private function ClearBar( )
listens to a change in stats.
private function SlotStatChanged( stat: Number, value: Number )
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 SetMax( maxStat: Number, snap: Boolean ) : Void
Updates the stat text and bar
private function SetCurrent( stat: Number, snap: Boolean ) : Void
Updates the text that overlays the healthbar updates it as percent or real numbers
private function UpdateStatText()
private function UpdateStatBar( snap: Boolean )
public function Hide()
public function Show()
show the text
public function SetShowText( showText: Boolean )
How to display the text, as numbers or percent
public function SetTextType( textType: Number )