Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Text

Hierarchy

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • Parameters

    • Optional text: string
    • Optional style: TextStyleOptions
    • Optional canvas: HTMLCanvasElement

    Returns Text

Properties

Protected _anchor

Protected _bounds

_bounds: Bounds

Protected _boundsID

_boundsID: number

Protected _boundsRect

_boundsRect: Rectangle

Protected _cacheAsBitmap

_cacheAsBitmap: boolean

Protected _cacheData

_cacheData: boolean

Protected _destroyed

_destroyed: boolean

Protected _enabledFilters

_enabledFilters: Filter[] | null

Protected _filters

_filters: Filter[] | null

Protected _font

_font: string

Protected _height

_height: number

Protected _lastBoundsID

_lastBoundsID: number

Protected _localBoundsRect

_localBoundsRect: Rectangle

Protected _mask

_mask: Graphics | Sprite

Protected _onStyleChange

_onStyleChange: function

Type declaration

    • (): void
    • Returns void

Protected _style

_style: TextStyle

Protected _styleListener

_styleListener: Function

Protected _text

_text: string

Protected _texture

_texture: Texture

Protected _textureID

_textureID: number

Protected _textureTrimmedID

_textureTrimmedID: number

Protected _tint

_tint: number

Protected _tintRGB

_tintRGB: number

Protected _transformID

_transformID: number

Protected _transformTrimmedID

_transformTrimmedID: number

Protected _width

_width: number

accessible

accessible: boolean

accessibleHint

accessibleHint: string | null

accessibleTitle

accessibleTitle: string | null

alpha

alpha: number

anchor

blendMode

blendMode: number

buttonMode

buttonMode: boolean

cacheAsBitmap

cacheAsBitmap: boolean

Protected cachedTint

cachedTint: number

canvas

canvas: HTMLCanvasElement

children

children: DisplayObject[]

context

context: CanvasRenderingContext2D

cursor

cursor: string

defaultCursor

defaultCursor: string

dirty

dirty: boolean

filterArea

filterArea: Rectangle

filters

filters: Filter[] | null

height

height: number

hitArea

interactive

interactive: boolean

interactiveChildren

interactiveChildren: boolean

Protected localStyleID

localStyleID: number

localTransform

localTransform: Matrix

mask

name

name: string | null

Protected onChildrenChange

onChildrenChange: function

Type declaration

    • (...args: any[]): void
    • Parameters

      • Rest ...args: any[]

      Returns void

parent

parent: Container

pivot

pluginName

pluginName: string

position

renderable

renderable: boolean

resolution

resolution: number

rotation

rotation: number

scale

skew

style

style: TextStyle

tabIndex

tabIndex: number

text

text: string

texture

texture: Texture

Protected textureDirty

textureDirty: boolean

tint

tint: number

transform

transform: TransformBase

vertexData

vertexData: Float32Array

Protected vertexTrimmedData

vertexTrimmedData: Float32Array

visible

visible: boolean

width

width: number

worldAlpha

worldAlpha: number

worldTransform

worldTransform: Matrix

worldVisible

worldVisible: boolean

x

x: number

y

y: number

Static EventEmitter

EventEmitter: object

Type declaration

  • constructor: function
    • Returns EventEmitter

  • prefixed: string | boolean

Static prefixed

prefixed: string | boolean

Methods

Protected _cacheAsBitmapDestroy

  • _cacheAsBitmapDestroy(options: boolean | any): void

Protected _calculateBounds

  • _calculateBounds(): void

Protected _calculateCachedBounds

Protected _destroyCachedDisplayObject

  • _destroyCachedDisplayObject(): void

Protected _generateFillStyle

  • _generateFillStyle(style: TextStyle, lines: string[]): string | number | CanvasGradient
  • Parameters

    Returns string | number | CanvasGradient

Protected _getCachedLocalBounds

Protected _initCachedDisplayObject

Protected _initCachedDisplayObjectCanvas

Protected _onTextureUpdate

  • _onTextureUpdate(): void

Protected _recursivePostUpdateTransform

  • _recursivePostUpdateTransform(): void

Protected _renderCachedCanvas

Protected _renderCachedWebGL

Protected _renderCanvas

Protected _renderWebGL

addChild

  • addChild<T>(child: T, ...additionalChildren: DisplayObject[]): T

addChildAt

  • addChildAt<T>(child: T, index: number): T
  • Type parameters

    Parameters

    • child: T
    • index: number

    Returns T

addListener

calculateBounds

  • calculateBounds(): void

Protected calculateTrimmedVertices

  • calculateTrimmedVertices(): void

calculateVertices

  • calculateVertices(): void

Protected containerUpdateTransform

  • containerUpdateTransform(): void

containsPoint

  • containsPoint(point: Point): boolean
  • Parameters

    Returns boolean

destroy

  • Parameters

    Returns void

Protected displayObjectUpdateTransform

  • displayObjectUpdateTransform(): void

Protected drawLetterSpacing

  • drawLetterSpacing(text: string, x: number, y: number, isStroke?: boolean): void
  • Parameters

    • text: string
    • x: number
    • y: number
    • Optional isStroke: boolean

    Returns void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Calls each of the listeners registered for a given event.

    Parameters

    • event: string | symbol

      The event name.

    • Rest ...args: any[]

      Arguments that are passed to registered listeners

    Returns boolean

    true if the event had listeners, else false.

eventNames

  • eventNames(): Array<string | symbol>
  • Return an array listing the events for which the emitter has registered listeners.

    Returns Array<string | symbol>

getBounds

getChildAt

getChildByName

getChildIndex

getGlobalPosition

  • getGlobalPosition(point?: Point, skipUpdate?: boolean): Point

getLocalBounds

listeners

  • listeners(event: string | symbol): Function[]
  • listeners(event: string | symbol, exists: boolean): boolean
  • Return the listeners registered for a given event.

    Parameters

    • event: string | symbol

      The event name.

    Returns Function[]

  • Check if there listeners for a given event. If exists argument is not true lists listeners.

    Parameters

    • event: string | symbol

      The event name.

    • exists: boolean

      Only check if there are listeners.

    Returns boolean

off

  • off(event: "added" | "removed" | string, fn?: Function, context?: any): this
  • Parameters

    • event: "added" | "removed" | string
    • Optional fn: Function
    • Optional context: any

    Returns this

on

  • on(event: "added" | "removed", fn: function, context?: any): this
  • on(event: string, fn: Function, context?: any): this
  • Parameters

    • event: "added" | "removed"
    • fn: function
    • Optional context: any

    Returns this

  • Parameters

    • event: string
    • fn: Function
    • Optional context: any

    Returns this

Protected onAnchorUpdate

  • onAnchorUpdate(): void
  • Returns void

once

  • once(event: "added" | "removed", fn: function, context?: any): this
  • once(event: string, fn: Function, context?: any): this
  • Parameters

    • event: "added" | "removed"
    • fn: function
    • Optional context: any

    Returns this

  • Parameters

    • event: string
    • fn: Function
    • Optional context: any

    Returns this

removeAllListeners

removeChild

removeChildAt

removeChildren

  • removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]
  • Parameters

    • Optional beginIndex: number
    • Optional endIndex: number

    Returns DisplayObject[]

removeListener

renderAdvancedWebGL

renderCanvas

renderWebGL

setChildIndex

setMaxListeners

  • setMaxListeners(): this
  • This function doesn't apply anymore.

    deprecated

    Returns this

setParent

setTransform

  • setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): DisplayObject
  • Parameters

    • Optional x: number
    • Optional y: number
    • Optional scaleX: number
    • Optional scaleY: number
    • Optional rotation: number
    • Optional skewX: number
    • Optional skewY: number
    • Optional pivotX: number
    • Optional pivotY: number

    Returns DisplayObject

swapChildren

toGlobal

toLocal

trackedPointers

  • trackedPointers(): object

Protected updateText

  • updateText(respectDirty?: boolean): void
  • Parameters

    • Optional respectDirty: boolean

    Returns void

Protected updateTexture

  • updateTexture(): void
  • Returns void

updateTransform

  • updateTransform(): void

Static from

  • from(source: number | string | BaseTexture | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): Sprite
  • Parameters

    • source: number | string | BaseTexture | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement

    Returns Sprite

Static fromFrame

  • fromFrame(frameId: string): Sprite
  • Parameters

    • frameId: string

    Returns Sprite

Static fromImage

  • fromImage(imageId: string, crossorigin?: boolean, scaleMode?: number): Sprite
  • Parameters

    • imageId: string
    • Optional crossorigin: boolean
    • Optional scaleMode: number

    Returns Sprite

Generated using TypeDoc