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.

### Hierarchy

- EventDispatcher
  - TextOptions

## Index

### Constructors

- constructor

### Properties

- autoScale
- autoSize
- isHtmlText
- padding
- textureFormat
- textureScale
- wordWrap

### Methods

- addEventListener
- clone
- copyFrom
- dispatchEvent
- dispatchEventWith
- get_autoScale
- get_autoSize
- get_isHtmlText
- get_padding
- get_textureFormat
- get_textureScale
- get_wordWrap
- hasEventListener
- removeEventListener
- removeEventListeners
- set_autoScale
- set_autoSize
- set_isHtmlText
- set_padding
- set_textureFormat
- set_textureScale
- set_wordWrap

## Constructors

### constructor

- new TextOptions(wordWrap?: boolean, autoScale?: boolean): TextOptions

- Overrides EventDispatcher.constructor

  - Defined in lib/starling/text/TextOptions.d.ts:16

  Creates a new TextOptions instance with the given properties.

  #### Parameters

  - ##### Optional wordWrap: boolean

  - ##### Optional autoScale: boolean

  #### Returns TextOptions

## Properties

### autoScale

autoScale: boolean

- Defined in lib/starling/text/TextOptions.d.ts:42

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

### autoSize

autoSize: string

- Defined in lib/starling/text/TextOptions.d.ts:36

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. @default none

### isHtmlText

isHtmlText: boolean

- Defined in lib/starling/text/TextOptions.d.ts:49

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. @default false

### padding

padding: number

- Defined in lib/starling/text/TextOptions.d.ts:75

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. @default 0.0

### textureFormat

textureFormat: string

- Defined in lib/starling/text/TextOptions.d.ts:68

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

### textureScale

textureScale: number

- Defined in lib/starling/text/TextOptions.d.ts:62

The scale factor of any textures that are created during text composition. @default Starling.contentScaleFactor

### wordWrap

wordWrap: boolean

- Defined in lib/starling/text/TextOptions.d.ts:28

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

## Methods

### addEventListener

- addEventListener(type: string, listener: Function): void

- Inherited from EventDispatcher.addEventListener

  - Defined in lib/starling/events/EventDispatcher.d.ts:32

  Registers an event listener at a certain object.

  #### Parameters

  - ##### type: string

  - ##### listener: Function

  #### Returns void

### clone

- clone(): TextOptions

- - Defined in lib/starling/text/TextOptions.d.ts:24

  Creates a clone of this instance.

  #### Returns TextOptions

### copyFrom

- copyFrom(options: TextOptions): void

- - Defined in lib/starling/text/TextOptions.d.ts:21

  Copies all properties from another TextOptions instance.

  #### Parameters

  - ##### options: TextOptions

  #### Returns void

### dispatchEvent

- dispatchEvent(event: Event): void

- Inherited from EventDispatcher.dispatchEvent

  - Defined in lib/starling/events/EventDispatcher.d.ts:45

  Dispatches an event to all objects that have registered listeners for its type. If an event with enabled 'bubble' property is dispatched to a display object, it will travel up along the line of parents, until it either hits the root object or someone stops its propagation manually.

  #### Parameters

  - ##### event: Event

  #### Returns void

### dispatchEventWith

- dispatchEventWith(type: string, bubbles?: boolean, data?: any): void

- Inherited from EventDispatcher.dispatchEventWith

  - Defined in lib/starling/events/EventDispatcher.d.ts:50

  Dispatches an event with the given parameters to all objects that have registered listeners for the given type. The method uses an internal pool of event objects to avoid allocations.

  #### Parameters

  - ##### type: string

  - ##### Optional bubbles: boolean

  - ##### Optional data: any

  #### Returns void

### Protected get_autoScale

- get_autoScale(): boolean

- - Defined in lib/starling/text/TextOptions.d.ts:43

  #### Returns boolean

### Protected get_autoSize

- get_autoSize(): string

- - Defined in lib/starling/text/TextOptions.d.ts:37

  #### Returns string

### Protected get_isHtmlText

- get_isHtmlText(): boolean

- - Defined in lib/starling/text/TextOptions.d.ts:50

  #### Returns boolean

### Protected get_padding

- get_padding(): number

- - Defined in lib/starling/text/TextOptions.d.ts:76

  #### Returns number

### Protected get_textureFormat

- get_textureFormat(): string

- - Defined in lib/starling/text/TextOptions.d.ts:69

  #### Returns string

### Protected get_textureScale

- get_textureScale(): number

- - Defined in lib/starling/text/TextOptions.d.ts:63

  #### Returns number

### Protected get_wordWrap

- get_wordWrap(): boolean

- - Defined in lib/starling/text/TextOptions.d.ts:29

  #### Returns boolean

### hasEventListener

- hasEventListener(type: string, listener?: any): boolean

- Inherited from EventDispatcher.hasEventListener

  - Defined in lib/starling/events/EventDispatcher.d.ts:55

  If called with one argument, figures out if there are any listeners registered for the given event type. If called with two arguments, also determines if a specific listener is registered.

  #### Parameters

  - ##### type: string

  - ##### Optional listener: any

  #### Returns boolean

### removeEventListener

- removeEventListener(type: string, listener: Function): void

- Inherited from EventDispatcher.removeEventListener

  - Defined in lib/starling/events/EventDispatcher.d.ts:35

  Removes an event listener from the object.

  #### Parameters

  - ##### type: string

  - ##### listener: Function

  #### Returns void

### removeEventListeners

- removeEventListeners(type?: string): void

- Inherited from EventDispatcher.removeEventListeners

  - Defined in lib/starling/events/EventDispatcher.d.ts:39

  Removes all event listeners with a certain type, or all of them if type is null. Be careful when removing all event listeners: you never know who else was listening.

  #### Parameters

  - ##### Optional type: string

  #### Returns void

### Protected set_autoScale

- set_autoScale(value: boolean): boolean

- - Defined in lib/starling/text/TextOptions.d.ts:44

  #### Parameters

  - ##### value: boolean

  #### Returns boolean

### Protected set_autoSize

- set_autoSize(value: string): string

- - Defined in lib/starling/text/TextOptions.d.ts:38

  #### Parameters

  - ##### value: string

  #### Returns string

### Protected set_isHtmlText

- set_isHtmlText(value: boolean): boolean

- - Defined in lib/starling/text/TextOptions.d.ts:51

  #### Parameters

  - ##### value: boolean

  #### Returns boolean

### Protected set_padding

- set_padding(value: number): number

- - Defined in lib/starling/text/TextOptions.d.ts:77

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_textureFormat

- set_textureFormat(value: string): string

- - Defined in lib/starling/text/TextOptions.d.ts:70

  #### Parameters

  - ##### value: string

  #### Returns string

### Protected set_textureScale

- set_textureScale(value: number): number

- - Defined in lib/starling/text/TextOptions.d.ts:64

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_wordWrap

- set_wordWrap(value: boolean): boolean

- - Defined in lib/starling/text/TextOptions.d.ts:30

  #### Parameters

  - ##### value: boolean

  #### Returns boolean

Generated using TypeDoc