Packagecom.nocircleno.graffiti.tools
Classpublic class TextSettings
InheritanceTextSettings Inheritance Object

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 10 - AIR 1.5

TextSettings Class is used to configure the look of text for the graffiti library.



Public Properties
 PropertyDefined By
  backgroundColor : int
TextSettings
  borderColor : int
TextSettings
  embeddedFont : Boolean
[read-only] Is the font used an embedded font.
TextSettings
  font : Font
TextSettings
  textFormat : TextFormat
TextSettings
Public Methods
 MethodDefined By
  
TextSettings(font:Font, textFormat:TextFormat, backgroundColor:int = -1, borderColor:int = -1)
The TextSettings constructor.
TextSettings
  
The clone method will return a new instance of the TextSettings.
TextSettings
Property Detail
backgroundColorproperty
backgroundColor:int  [read-write]


Implementation
    public function get backgroundColor():int
    public function set backgroundColor(value:int):void
borderColorproperty 
borderColor:int  [read-write]


Implementation
    public function get borderColor():int
    public function set borderColor(value:int):void
embeddedFontproperty 
embeddedFont:Boolean  [read-only]

Is the font used an embedded font.


Implementation
    public function get embeddedFont():Boolean
fontproperty 
font:Font  [read-write]


Implementation
    public function get font():Font
    public function set font(value:Font):void
textFormatproperty 
textFormat:TextFormat  [read-write]


Implementation
    public function get textFormat():TextFormat
    public function set textFormat(value:TextFormat):void
Constructor Detail
TextSettings()Constructor
public function TextSettings(font:Font, textFormat:TextFormat, backgroundColor:int = -1, borderColor:int = -1)

The TextSettings constructor.

Parameters
font:Font — Font object used for text.
 
textFormat:TextFormat — TextFormat Object used to display Text.
 
backgroundColor:int (default = -1) — Background Color used for the text, set to -1 for no background.
 
borderColor:int (default = -1) — Border Color used for the text, set to -1 for no border.

Example
The following code creates an instance of the TextSettings.
        var allFonts:Array = Font.enumerateFonts(true);
        allFonts.sortOn("fontName", Array.CASEINSENSITIVE);
        
        var fmt:TextFormat = new TextFormat();
        fmt.size = 22;
        fmt.color = 0x000000;
        
        var textSettings:TextSettings = new TextSettings(Font(allFonts[0]), fmt, -1, 0xFF0000);
        
Method Detail
clone()method
public function clone():TextSettings

The clone method will return a new instance of the TextSettings.

Returns
TextSettings — Returns new TextSettings with all the same settings.