Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TextOptions

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

Index

Constructors

constructor

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

Properties

autoScale

autoScale: boolean

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

autoSize

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

isHtmlText

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

padding

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

textureFormat

textureFormat: string

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

textureScale

textureScale: number

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

wordWrap

wordWrap: boolean

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

clone

copyFrom

dispatchEvent

  • dispatchEvent(event: Event): void
  • 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

    Returns void

dispatchEventWith

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

Protected get_autoScale

  • get_autoScale(): boolean

Protected get_autoSize

  • get_autoSize(): string

Protected get_isHtmlText

  • get_isHtmlText(): boolean

Protected get_padding

  • get_padding(): number

Protected get_textureFormat

  • get_textureFormat(): string

Protected get_textureScale

  • get_textureScale(): number

Protected get_wordWrap

  • get_wordWrap(): boolean

hasEventListener

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

removeEventListener

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

removeEventListeners

  • removeEventListeners(type?: string): void

Protected set_autoScale

  • set_autoScale(value: boolean): boolean

Protected set_autoSize

  • set_autoSize(value: string): string

Protected set_isHtmlText

  • set_isHtmlText(value: boolean): boolean

Protected set_padding

  • set_padding(value: number): number

Protected set_textureFormat

  • set_textureFormat(value: string): string

Protected set_textureScale

  • set_textureScale(value: number): number

Protected set_wordWrap

  • set_wordWrap(value: boolean): boolean

Generated using TypeDoc