| Package | starling.text |
| Class | public class TextOptions |
| Inheritance | TextOptions EventDispatcher Object |
Note that not all properties are supported by all text compositors.
| Property | Defined 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 | ||
| Method | Defined By | ||
|---|---|---|---|
TextOptions(wordWrap:Boolean = true, autoScale:Boolean = false) Creates a new TextOptions instance with the given properties. | TextOptions | ||
![]() | 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 | ||
![]() | dispatchEvent(event:Event):void Dispatches an event to all objects that have registered listeners for its type. | EventDispatcher | |
![]() | 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 | |
![]() | 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 | |
![]() | removeEventListener(type:String, listener:Function):void Removes an event listener from the object. | EventDispatcher | |
![]() | removeEventListeners(type:String = null):void Removes all event listeners with a certain type, or all of them if type is null. | EventDispatcher | |
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when any property of the instance changes. | TextOptions | |||
| autoScale | property |
autoScale:BooleanIndicates whether the font size is automatically reduced if the complete text does not fit into the TextField.
The default value is false.
public function get autoScale():Boolean public function set autoScale(value:Boolean):void| autoSize | property |
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.
public function get autoSize():String public function set autoSize(value:String):void| isHtmlText | property |
isHtmlText:BooleanIndicates 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.
public function get isHtmlText():Boolean public function set isHtmlText(value:Boolean):void| padding | property |
padding:NumberThe 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.
public function get padding():Number public function set padding(value:Number):void| styleSheet | property |
styleSheet:StyleSheetAn optional style sheet to be used for HTML text.
The default value is null.
public function get styleSheet():StyleSheet public function set styleSheet(value:StyleSheet):void| textureFormat | property |
textureFormat:StringThe Context3DTextureFormat of any textures that are created during text composition.
The default value is Context3DTextureFormat.BGRA_PACKED.
public function get textureFormat():String public function set textureFormat(value:String):void| textureScale | property |
textureScale:NumberThe 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.
public function get textureScale():Number public function set textureScale(value:Number):void| wordWrap | property |
wordWrap:BooleanIndicates if the text should be wrapped at word boundaries if it does not fit into the TextField otherwise.
The default value is true.
public function get wordWrap():Boolean public function set wordWrap(value:Boolean):void| TextOptions | () | Constructor |
public function TextOptions(wordWrap:Boolean = true, autoScale:Boolean = false)Creates a new TextOptions instance with the given properties.
ParameterswordWrap:Boolean (default = true) | |
autoScale:Boolean (default = false) |
| clone | () | method |
| copyFrom | () | method |
public function copyFrom(options:TextOptions):voidCopies all properties from another TextOptions instance.
Parameters
options:TextOptions |
| change | Event |