Packagestarling.text
Classpublic class TextOptions
InheritanceTextOptions Inheritance EventDispatcher Inheritance Object

The TextOptions class contains data that describes how the letters of a text should be assembled on text composition.

Note that not all properties are supported by all text compositors.



Public Properties
 PropertyDefined By
  autoScale : Boolean
Indicates whether the font size is automatically reduced if the complete text does not fit into the TextField.
TextOptions
  autoSize : String
Specifies the type of auto-sizing set on the TextField.
TextOptions
  isHtmlText : Boolean
Indicates if text should be interpreted as HTML code.
TextOptions
  padding : Number
The padding (in points) that's added to the sides of text that's rendered to a Bitmap.
TextOptions
  styleSheet : StyleSheet
An optional style sheet to be used for HTML text.
TextOptions
  textureFormat : String
The Context3DTextureFormat of any textures that are created during text composition.
TextOptions
  textureScale : Number
The scale factor of any textures that are created during text composition.
TextOptions
  wordWrap : Boolean
Indicates if the text should be wrapped at word boundaries if it does not fit into the TextField otherwise.
TextOptions
Public Methods
 MethodDefined By
  
TextOptions(wordWrap:Boolean = true, autoScale:Boolean = false)
Creates a new TextOptions instance with the given properties.
TextOptions
 Inherited
addEventListener(type:String, listener:Function):void
Registers an event listener at a certain object.
EventDispatcher
  
Creates a clone of this instance.
TextOptions
  
copyFrom(options:TextOptions):void
Copies all properties from another TextOptions instance.
TextOptions
 Inherited
dispatchEvent(event:Event):void
Dispatches an event to all objects that have registered listeners for its type.
EventDispatcher
 Inherited
dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void
Dispatches an event with the given parameters to all objects that have registered listeners for the given type.
EventDispatcher
 Inherited
hasEventListener(type:String, listener:Function = null):Boolean
If called with one argument, figures out if there are any listeners registered for the given event type.
EventDispatcher
 Inherited
removeEventListener(type:String, listener:Function):void
Removes an event listener from the object.
EventDispatcher
 Inherited
removeEventListeners(type:String = null):void
Removes all event listeners with a certain type, or all of them if type is null.
EventDispatcher
Events
 Event Summary Defined By
  Dispatched when any property of the instance changes.TextOptions
Property Detail
autoScaleproperty
autoScale:Boolean

Indicates whether the font size is automatically reduced if the complete text does not fit into the TextField.

The default value is false.


Implementation
    public function get autoScale():Boolean
    public function set autoScale(value:Boolean):void
autoSizeproperty 
autoSize:String

Specifies the type of auto-sizing set on the TextField. Custom text compositors may take this into account, though the basic implementation (done by the TextField itself) is often sufficient: it passes a very big size to the fillMeshBatch method and then trims the result to the actually used area.

The default value is none.


Implementation
    public function get autoSize():String
    public function set autoSize(value:String):void
isHtmlTextproperty 
isHtmlText:Boolean

Indicates if text should be interpreted as HTML code. For a description of the supported HTML subset, refer to the classic Flash 'TextField' documentation. Beware: Only supported for TrueType fonts.

The default value is false.


Implementation
    public function get isHtmlText():Boolean
    public function set isHtmlText(value:Boolean):void
paddingproperty 
padding:Number

The padding (in points) that's added to the sides of text that's rendered to a Bitmap. If your text is truncated on the sides (which may happen if the font returns incorrect bounds), padding can make up for that. Value must be positive.

The default value is 0.0.


Implementation
    public function get padding():Number
    public function set padding(value:Number):void
styleSheetproperty 
styleSheet:StyleSheet

An optional style sheet to be used for HTML text.

The default value is null.


Implementation
    public function get styleSheet():StyleSheet
    public function set styleSheet(value:StyleSheet):void
textureFormatproperty 
textureFormat:String

The Context3DTextureFormat of any textures that are created during text composition.

The default value is Context3DTextureFormat.BGRA_PACKED.


Implementation
    public function get textureFormat():String
    public function set textureFormat(value:String):void
textureScaleproperty 
textureScale:Number

The scale factor of any textures that are created during text composition. The optimal value for this property is determined directly before rendering; manual changes will be ignored.

Note that this property does NOT dispatch CHANGE events.


Implementation
    public function get textureScale():Number
    public function set textureScale(value:Number):void
wordWrapproperty 
wordWrap:Boolean

Indicates if the text should be wrapped at word boundaries if it does not fit into the TextField otherwise.

The default value is true.


Implementation
    public function get wordWrap():Boolean
    public function set wordWrap(value:Boolean):void
Constructor Detail
TextOptions()Constructor
public function TextOptions(wordWrap:Boolean = true, autoScale:Boolean = false)

Creates a new TextOptions instance with the given properties.

Parameters
wordWrap:Boolean (default = true)
 
autoScale:Boolean (default = false)
Method Detail
clone()method
public function clone():TextOptions

Creates a clone of this instance.

Returns
TextOptions
copyFrom()method 
public function copyFrom(options:TextOptions):void

Copies all properties from another TextOptions instance.

Parameters

options:TextOptions

Event Detail
change Event
Event Object Type: starling.events.Event

Dispatched when any property of the instance changes.