PackageAndrograde
Classpublic class UI

Does all the drawing of all the UI widgets



Public Properties
 PropertyDefined by
  BORDER_ROUNDING : uint = 8
How rounded the borders are
UI
  BORDER_WIDTH : uint = 4
The width of the border of the dialog boxes
UI
  BUTTON_BRIGHTNESS_SELECTED : Number = 1.5
The brightness for button when they're selected
UI
  BUTTON_PADDINGX : Number = 8
The x padding for buttons
UI
  BUTTON_PADDINGY : Number = 0
The y padding for buttons
UI
  COLOR_ALERT : uint = 0xE67373
The color of the error alert panels to display
UI
  COLOR_BUTTON_BG : uint
The color of the button background
UI
  COLOR_BUTTON_BORDER : uint
The color of the button border
UI
  COLOR_BUTTON_CANCEL : uint = 0xff4343
The color of the cancel button
UI
  COLOR_BUTTON_TEXT : uint = 0x0096ff
The color of the button text
UI
  COLOR_INPUT_BG : uint = 0xeffbff
The background color of input text boxes to display
UI
  COLOR_INPUT_BORDER : uint
The border color of input text boxes to display
UI
  COLOR_INPUT_TEXT : uint = 0x777777
The text color of the input text boxes to display
UI
  COLOR_PANEL : uint = 0xffffff
The color of the dialog boxes to display
UI
  COLOR_PANEL_BORDER : uint = 0x18aece
The color of the border of the dialog boxes
UI
  COLOR_TEXT : uint = 0x0096ff
The color of the text in the dialog boxes to display
UI
  COLOR_TEXT_HIGHLIGHT : uint = 0xff8a17
The color of the highlighted text
UI
  COLOR_TITLE_BG : uint = 0xffffff
The color of the title background in the dialog boxes to display
UI
  COLOR_TITLE_TEXT : uint = 0x004b80
The color of the title text in the dialog boxes to display
UI
  FONT_FACE : String
get/set the face of the default font Make sure to do Font.registerFont(your font class); otherwise the font face will not be used
UI
  FONT_SIZE : uint = 12
The size of the default font
UI
Protected Properties
 PropertyDefined by
  font_embedded : Boolean
UI
  font_face : String = "Arial"
UI
Public Methods
 MethodDefined by
  
addFocusHandler(object:InteractiveObject, next:InteractiveObject):void
Puts a display object in the tab order for the containing sprite
UI
  
addReturnHandler(object:InteractiveObject, handler:Function):void
sets up a function to call when the user presses the enter key on a display object
UI
  
alert(text:String, container:DisplayObjectContainer, parent:DisplayObjectContainer):void
UI
  
cancelButton(x:Number, y:Number, cancelFunc:Function):Sprite
Creates a cancel button
UI
  
panel(panel:Sprite, title:String, cancelFunc:Function = null, color:uint = 1):void
Converts a Sprite with stuff drawn to it already to a panel
ex: UI.panel(mypanel, mypanel.width, mypanel.height, "My Panel", cancel);
UI
  
text(text:String, color:uint = 1, font_size:uint = 0, width:uint = 0, height:uint = 0, multiline:Boolean = false, selectable:Boolean = false):TextField
Makes a TextField that has the Andrograde look and feel
UI
  
tooltip(parent:DisplayObjectContainer, _text:String):void
Shows a tooltip for a widget upon mouse over
UI
Property detail
BORDER_ROUNDINGproperty
public var BORDER_ROUNDING:uint = 8

How rounded the borders are

BORDER_WIDTHproperty 
public var BORDER_WIDTH:uint = 4

The width of the border of the dialog boxes

BUTTON_BRIGHTNESS_SELECTEDproperty 
public var BUTTON_BRIGHTNESS_SELECTED:Number = 1.5

The brightness for button when they're selected

BUTTON_PADDINGXproperty 
public var BUTTON_PADDINGX:Number = 8

The x padding for buttons

BUTTON_PADDINGYproperty 
public var BUTTON_PADDINGY:Number = 0

The y padding for buttons

COLOR_ALERTproperty 
public var COLOR_ALERT:uint = 0xE67373

The color of the error alert panels to display

COLOR_BUTTON_BGproperty 
public var COLOR_BUTTON_BG:uint

The color of the button background

COLOR_BUTTON_BORDERproperty 
public var COLOR_BUTTON_BORDER:uint

The color of the button border

COLOR_BUTTON_CANCELproperty 
public var COLOR_BUTTON_CANCEL:uint = 0xff4343

The color of the cancel button

COLOR_BUTTON_TEXTproperty 
public var COLOR_BUTTON_TEXT:uint = 0x0096ff

The color of the button text

COLOR_INPUT_BGproperty 
public var COLOR_INPUT_BG:uint = 0xeffbff

The background color of input text boxes to display

COLOR_INPUT_BORDERproperty 
public var COLOR_INPUT_BORDER:uint

The border color of input text boxes to display

COLOR_INPUT_TEXTproperty 
public var COLOR_INPUT_TEXT:uint = 0x777777

The text color of the input text boxes to display

COLOR_PANELproperty 
public var COLOR_PANEL:uint = 0xffffff

The color of the dialog boxes to display

COLOR_PANEL_BORDERproperty 
public var COLOR_PANEL_BORDER:uint = 0x18aece

The color of the border of the dialog boxes

COLOR_TEXTproperty 
public var COLOR_TEXT:uint = 0x0096ff

The color of the text in the dialog boxes to display

COLOR_TEXT_HIGHLIGHTproperty 
public var COLOR_TEXT_HIGHLIGHT:uint = 0xff8a17

The color of the highlighted text

COLOR_TITLE_BGproperty 
public var COLOR_TITLE_BG:uint = 0xffffff

The color of the title background in the dialog boxes to display

COLOR_TITLE_TEXTproperty 
public var COLOR_TITLE_TEXT:uint = 0x004b80

The color of the title text in the dialog boxes to display

font_embeddedproperty 
protected var font_embedded:Boolean
font_faceproperty 
protected var font_face:String = "Arial"
FONT_FACEproperty 
FONT_FACE:String  [read-write]

get/set the face of the default font Make sure to do Font.registerFont(your font class); otherwise the font face will not be used

Implementation
    public function get FONT_FACE():String
    public function set FONT_FACE(value:String):void

Example
[Embed(mimeType="application/x-font-truetype", source = "myfont.ttf", fontFamily = "my font")] public var myFont:Class; // for Flash Develop
Font.registerFont(myFont);
AndrogradeAPI.UI.FONT_FACE= "my font";

FONT_SIZEproperty 
public var FONT_SIZE:uint = 12

The size of the default font

Method detail
addFocusHandler()method
public function addFocusHandler(object:InteractiveObject, next:InteractiveObject):void

Puts a display object in the tab order for the containing sprite

Parameters
object:InteractiveObject — the object to put in the tab order
 
next:InteractiveObject — the thing that should be selected next
addReturnHandler()method 
public function addReturnHandler(object:InteractiveObject, handler:Function):void

sets up a function to call when the user presses the enter key on a display object

Parameters
object:InteractiveObject — what object to check
 
handler:Function — what function to call, must be function(e:KeyboardEvent):void
alert()method 
public function alert(text:String, container:DisplayObjectContainer, parent:DisplayObjectContainer):voidParameters
text:String
 
container:DisplayObjectContainer
 
parent:DisplayObjectContainer
cancelButton()method 
public function cancelButton(x:Number, y:Number, cancelFunc:Function):Sprite

Creates a cancel button

Parameters
x:Number
 
y:Number
 
cancelFunc:Function — the function to call when they click the button

Returns
Sprite — Sprite containing the cancel button
panel()method 
public function panel(panel:Sprite, title:String, cancelFunc:Function = null, color:uint = 1):void

Converts a Sprite with stuff drawn to it already to a panel
ex: UI.panel(mypanel, mypanel.width, mypanel.height, "My Panel", cancel);

Parameters
panel:Sprite — the Sprite to use for the panel
 
title:String — the title of the panel
 
cancelFunc:Function (default = null) — function to call when the cancel button is pressed
 
color:uint (default = 1) — the bg color of the panel, setting to 1 defaults it to UI.COLOR_PANEL
text()method 
public function text(text:String, color:uint = 1, font_size:uint = 0, width:uint = 0, height:uint = 0, multiline:Boolean = false, selectable:Boolean = false):TextField

Makes a TextField that has the Andrograde look and feel

Parameters
text:String
 
color:uint (default = 1) — color the text color, setting to 1 defaults it to UI.COLOR_TEXT
 
font_size:uint (default = 0) — font_size the size of the font to use, 0 to use the default UI.FONT_SIZE
 
width:uint (default = 0) — 0 for automatic
 
height:uint (default = 0) — 0 for automatic
 
multiline:Boolean (default = false) — whether it is multiple lines
 
selectable:Boolean (default = false) — whether you can select/click on it

Returns
TextField — a TextField that is ready to use
tooltip()method 
public function tooltip(parent:DisplayObjectContainer, _text:String):void

Shows a tooltip for a widget upon mouse over

Parameters
parent:DisplayObjectContainer
 
_text:String