Package | verlocity.display.ui |
Class | public class Button |
Inheritance | Button ![]() ![]() ![]() |
Subclasses | PauseButton |
Property | Defined By | ||
---|---|---|---|
bIsDisabled : Boolean | Button | ||
bIsHighlighted : Boolean | Button | ||
bIsSelected : Boolean | Button | ||
bMouseOver : Boolean | Button | ||
fCondition : Function | Button | ||
fFunction : Function | Button | ||
iState : int | Button | ||
![]() | nScale : Number | UIElement | |
![]() | tfTextField : TextField | Text | |
![]() | tfTextFormat : TextFormat | Text |
Method | Defined By | ||
---|---|---|---|
Button(fSetFunction:Function = null, fSetCondition:Function = null, bAddToKeyInput:Boolean = true) | Button | ||
![]() | Clear():void
Clears all graphics drawn on the UI element. | UIElement | |
Dispose():void [override]
Destroys the entire button
| Button | ||
DoButton():void
Preforms the button's function
| Button | ||
![]() | DrawRect(uiColor:uint = 0xFFFFFF, nAlpha:Number = 1, iWidth:int = 0, iHeight:int = 0, bLine:Boolean = false, iLineThickness:int = 1, uiLineColor:uint = 0xFFFFFF, nLineAlpha:Number = 1, bRounded:Boolean = false, iRoundness:int = 10, iOffsetX:int = 0, iOffsetY:int = 1):void [override] | Text | |
![]() | GetHeight():int | Text | |
![]() | GetScale():Number
Returns the scale of the UI element. | UIElement | |
GetState():int
Returns the current state of the button. | Button | ||
![]() | GetWidth():int | Text | |
IsDisabled():Boolean
Returns if the button is disabled
| Button | ||
IsHighlighted():Boolean
Returns if the button is highlighted
| Button | ||
IsSelected():Boolean
Returns if the button is selected
| Button | ||
RemoveCondition():void
Removes the condition of the button. | Button | ||
![]() | ResetPos():void
Resets the X and Y position of the UI element to its original spawn position. | UIElement | |
ResetState():void
Resets the state of the button to its default. | Button | ||
SetButton(fSetFunction:Function, fSetCondition:Function = null):void
Sets the functions of the button
| Button | ||
SetEnabled(bEnable:Boolean):void
Enables/disables the button for use
| Button | ||
![]() | SetHeight(iHeight:int):void | Text | |
SetHighlighted(bHighlight:Boolean):void
Enables/disables highlighting the button, as if the mouse was over it. | Button | ||
![]() | SetOriginPos(nPosX:Number, nPosY:Number):void
Overrides origin position
| UIElement | |
![]() | SetPos(nPosX:Number, nPosY:Number):void
Sets the X and Y position of the UI element. | UIElement | |
![]() | SetScale(nSetScale:Number):void
Sets the scale of the UI element. | UIElement | |
SetSelected(bSelect:Boolean):void
Enables/disables selection of the button. | Button | ||
SetText(sText:String, tfTextFormat:TextFormat = null):void [override]
Sets the text to display on the button
| Button | ||
![]() | SetTextColor(uiColor:uint):void | Text | |
SetWidth(iWidth:int):void [override]
Sets the width of the button
| Button |
Method | Defined By | ||
---|---|---|---|
Disabled():void | Button | ||
Down():void | Button | ||
DrawBG():void | Button | ||
Out():void | Button | ||
Over():void | Button | ||
Press():void | Button | ||
Selected():void | Button | ||
Up():void | Button |
Constant | Defined By | ||
---|---|---|---|
STATE_DISABLED : int = 4 | Button | ||
STATE_DOWN : int = 3 | Button | ||
STATE_OUT : int = 1 | Button | ||
STATE_OVER : int = 2 | Button | ||
STATE_SELECTED : int = 5 | Button | ||
STATE_UP : int = 0 | Button |
bIsDisabled | property |
protected var bIsDisabled:Boolean
bIsHighlighted | property |
protected var bIsHighlighted:Boolean
bIsSelected | property |
protected var bIsSelected:Boolean
bMouseOver | property |
protected var bMouseOver:Boolean
fCondition | property |
protected var fCondition:Function
fFunction | property |
protected var fFunction:Function
iState | property |
protected var iState:int
Button | () | Constructor |
public function Button(fSetFunction:Function = null, fSetCondition:Function = null, bAddToKeyInput:Boolean = true)
fSetFunction:Function (default = null )
| |
fSetCondition:Function (default = null )
| |
bAddToKeyInput:Boolean (default = true )
|
Disabled | () | method |
protected function Disabled():void
Dispose | () | method |
override public function Dispose():void
Destroys the entire button
DoButton | () | method |
public function DoButton():void
Preforms the button's function
Down | () | method |
protected function Down():void
DrawBG | () | method |
protected function DrawBG():void
GetState | () | method |
public function GetState():int
Returns the current state of the button.
Returnsint —
|
IsDisabled | () | method |
public function IsDisabled():Boolean
Returns if the button is disabled
ReturnsBoolean —
|
IsHighlighted | () | method |
public function IsHighlighted():Boolean
Returns if the button is highlighted
ReturnsBoolean —
|
IsSelected | () | method |
public function IsSelected():Boolean
Returns if the button is selected
ReturnsBoolean |
Out | () | method |
protected function Out():void
Over | () | method |
protected function Over():void
Press | () | method |
protected function Press():void
RemoveCondition | () | method |
public function RemoveCondition():void
Removes the condition of the button.
ResetState | () | method |
public function ResetState():void
Resets the state of the button to its default.
Selected | () | method |
protected function Selected():void
SetButton | () | method |
public function SetButton(fSetFunction:Function, fSetCondition:Function = null):void
Sets the functions of the button
Parameters
fSetFunction:Function — The function the button preforms
| |
fSetCondition:Function (default = null ) — The conditional to check if the button should be selected or not
|
SetEnabled | () | method |
public function SetEnabled(bEnable:Boolean):void
Enables/disables the button for use
Parameters
bEnable:Boolean |
SetHighlighted | () | method |
public function SetHighlighted(bHighlight:Boolean):void
Enables/disables highlighting the button, as if the mouse was over it. This is used for key controls.
Parameters
bHighlight:Boolean |
SetSelected | () | method |
public function SetSelected(bSelect:Boolean):void
Enables/disables selection of the button. When a button is selected, it cannot be used. This is primarly for buttons that toggle settings.
Parameters
bSelect:Boolean |
SetText | () | method |
override public function SetText(sText:String, tfTextFormat:TextFormat = null):void
Sets the text to display on the button
Parameters
sText:String — Text to display
| |
tfTextFormat:TextFormat (default = null ) — The text format to use
|
SetWidth | () | method |
override public function SetWidth(iWidth:int):void
Sets the width of the button
Parameters
iWidth:int |
Up | () | method |
protected function Up():void
STATE_DISABLED | Constant |
public const STATE_DISABLED:int = 4
STATE_DOWN | Constant |
public const STATE_DOWN:int = 3
STATE_OUT | Constant |
public const STATE_OUT:int = 1
STATE_OVER | Constant |
public const STATE_OVER:int = 2
STATE_SELECTED | Constant |
public const STATE_SELECTED:int = 5
STATE_UP | Constant |
public const STATE_UP:int = 0