Packagecom.whirled.contrib.card.graphics
Classpublic class Text
InheritanceText Inheritance flash.text.TextField

Simple text field supporting outlines and vertical positioning. TODO: this may be useful for other games, move out of card package



Public Properties
 PropertyDefined by
  bottomY : Number
Access the coordinate of the bottom of the text field.
Text
  centerY : Number
Access the coordinate of the vertical center of the text field.
Text
  effectiveTextHeight : Number
[read-only] Access the effective text height for use with vertical positioning.
Text
Protected Properties
 PropertyDefined by
  _size : int
Text
Public Methods
 MethodDefined by
  
Text(size:int, foreColor:uint = 0xFFFFFF, backColor:uint = 0x000000)
Create a new standard text field of the given size.
Text
  
leftJustify():void
Set the text to left justify.
Text
  
rightJustify():void
Set the text to right justify.
Text
  
truncName(name:String):String
[static] Utility function to truncate a name.
Text
Protected Methods
 MethodDefined by
  
createFormat(size:int, italic:Boolean, color:uint):TextFormat
[static]
Text
  
createGlow(alpha:Number, size:int, strength:int, color:uint):GlowFilter
[static]
Text
Public Constants
 ConstantDefined by
  BIG : int = 1
[static] Initialization constant for a big standard text field.
Text
  HUGE : int = 2
[static] Initialization constant for a huge standard text field.
Text
  HUGE_HARD_ITALIC : int = 4
[static] Initialization constant for a huge text field in italics with a hard outline.
Text
  SMALL : int = 0
[static] Initialization constant for a small standard text field.
Text
  SMALL_ITALIC : int = 3
[static] Initialization constant for a small text field in italics.
Text
Protected Constants
 ConstantDefined by
  EFFECTIVE_SIZES : Array
[static]
Text
  FORMAT_PARAMS : Array
[static]
Text
  MAX_NAME_LENGTH : int = 12
[static]
Text
  OUTLINE_PARAMS : Array
[static]
Text
Property detail
bottomYproperty
bottomY:Number  [read-write]

Access the coordinate of the bottom of the text field.

Implementation
    public function get bottomY():Number
    public function set bottomY(value:Number):void
centerYproperty 
centerY:Number  [read-write]

Access the coordinate of the vertical center of the text field.

Implementation
    public function get centerY():Number
    public function set centerY(value:Number):void
effectiveTextHeightproperty 
effectiveTextHeight:Number  [read-only]

Access the effective text height for use with vertical positioning.

Implementation
    public function get effectiveTextHeight():Number
_sizeproperty 
protected var _size:int
Constructor detail
Text()constructor
public function Text(size:int, foreColor:uint = 0xFFFFFF, backColor:uint = 0x000000)

Create a new standard text field of the given size.

Parameters
size:int
 
foreColor:uint (default = 0xFFFFFF)
 
backColor:uint (default = 0x000000)
Method detail
createFormat()method
protected static function createFormat(size:int, italic:Boolean, color:uint):TextFormatParameters
size:int
 
italic:Boolean
 
color:uint

Returns
TextFormat
createGlow()method 
protected static function createGlow(alpha:Number, size:int, strength:int, color:uint):GlowFilterParameters
alpha:Number
 
size:int
 
strength:int
 
color:uint

Returns
GlowFilter
leftJustify()method 
public function leftJustify():void

Set the text to left justify.

rightJustify()method 
public function rightJustify():void

Set the text to right justify.

truncName()method 
public static function truncName(name:String):String

Utility function to truncate a name.

Parameters
name:String

Returns
String
Constant detail
BIGconstant
public static const BIG:int = 1

Initialization constant for a big standard text field.

EFFECTIVE_SIZESconstant 
protected static const EFFECTIVE_SIZES:Array
FORMAT_PARAMSconstant 
protected static const FORMAT_PARAMS:Array
HUGEconstant 
public static const HUGE:int = 2

Initialization constant for a huge standard text field.

HUGE_HARD_ITALICconstant 
public static const HUGE_HARD_ITALIC:int = 4

Initialization constant for a huge text field in italics with a hard outline.

MAX_NAME_LENGTHconstant 
protected static const MAX_NAME_LENGTH:int = 12
OUTLINE_PARAMSconstant 
protected static const OUTLINE_PARAMS:Array
SMALLconstant 
public static const SMALL:int = 0

Initialization constant for a small standard text field.

SMALL_ITALICconstant 
public static const SMALL_ITALIC:int = 3

Initialization constant for a small text field in italics.