Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseTexture

Hierarchy

Index

Constructors

constructor

  • new BaseTexture(source?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, scaleMode?: number, resolution?: number): BaseTexture
  • Parameters

    • Optional source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement
    • Optional scaleMode: number
    • Optional resolution: number

    Returns BaseTexture

Properties

Protected _destroyed

_destroyed: boolean

Protected _enabled

_enabled: number

Protected _glTextures

_glTextures: any

Protected Optional _id

_id: number

Protected _virtualBoundId

_virtualBoundId: number

hasLoaded

hasLoaded: boolean

height

height: number

imageType

imageType: string | null

imageUrl

imageUrl: string | null

isLoading

isLoading: boolean

Protected isPowerOfTwo

isPowerOfTwo: boolean

mipmap

mipmap: boolean

origSource

origSource: HTMLImageElement | null

premultipliedAlpha

premultipliedAlpha: boolean

realHeight

realHeight: number

realWidth

realWidth: number

resolution

resolution: number

scaleMode

scaleMode: number

source

source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | null

sourceScale

sourceScale: number

textureCacheIds

textureCacheIds: string[]

Protected touched

touched: number

Protected Optional uuid

uuid: number

width

width: number

Optional wrap

wrap: boolean

wrapMode

wrapMode: number

Static EventEmitter

EventEmitter: object

Type declaration

  • constructor: function
    • Returns EventEmitter

  • prefixed: string | boolean

Static prefixed

prefixed: string | boolean

Methods

Protected _loadSvgSource

  • _loadSvgSource(): void
  • Returns void

Protected _loadSvgSourceUsingDataUri

  • _loadSvgSourceUsingDataUri(dataUri: string): void
  • Parameters

    • dataUri: string

    Returns void

Protected _loadSvgSourceUsingString

  • _loadSvgSourceUsingString(svgString: string): void
  • Parameters

    • svgString: string

    Returns void

Protected _loadSvgSourceUsingXhr

  • _loadSvgSourceUsingXhr(): void
  • Returns void

Protected _sourceLoaded

  • _sourceLoaded(): void
  • Returns void

Protected _updateDimensions

  • _updateDimensions(): void
  • Returns void

Protected _updateImageType

  • _updateImageType(): void
  • Returns void

addListener

  • addListener(event: "update" | "loaded" | "error" | "dispose", fn: function, context?: any): this
  • Parameters

    • event: "update" | "loaded" | "error" | "dispose"
    • fn: function
    • Optional context: any

    Returns this

destroy

  • destroy(): void
  • Returns void

dispose

  • dispose(): void
  • 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>

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

Protected loadSource

  • loadSource(source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void
  • Parameters

    • source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement

    Returns void

off

  • off(event: "update" | "loaded" | "error" | "dispose", fn?: function, context?: any): this
  • Parameters

    • event: "update" | "loaded" | "error" | "dispose"
    • Optional fn: function
    • Optional context: any

    Returns this

on

  • on(event: "update" | "loaded" | "error" | "dispose", fn: function, context?: any): this
  • Parameters

    • event: "update" | "loaded" | "error" | "dispose"
    • fn: function
    • Optional context: any

    Returns this

once

  • once(event: "update" | "loaded" | "error" | "dispose", fn: function, context?: any): this
  • Parameters

    • event: "update" | "loaded" | "error" | "dispose"
    • fn: function
    • Optional context: any

    Returns this

removeAllListeners

  • removeAllListeners(event: "update" | "loaded" | "error" | "dispose"): this
  • Parameters

    • event: "update" | "loaded" | "error" | "dispose"

    Returns this

removeListener

  • removeListener(event: "update" | "loaded" | "error" | "dispose", fn?: function, context?: any): this
  • Parameters

    • event: "update" | "loaded" | "error" | "dispose"
    • Optional fn: function
    • Optional context: any

    Returns this

setMaxListeners

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

    deprecated

    Returns this

update

  • update(): void
  • Returns void

updateSourceImage

  • updateSourceImage(newSrc: string): void
  • Parameters

    • newSrc: string

    Returns void

Static addToCache

  • addToCache(baseTexture: BaseTexture, id: string): void
  • Parameters

    Returns void

Static from

  • from(source: string | HTMLImageElement | HTMLCanvasElement, scaleMode?: number, sourceScale?: number): BaseTexture
  • Parameters

    • source: string | HTMLImageElement | HTMLCanvasElement
    • Optional scaleMode: number
    • Optional sourceScale: number

    Returns BaseTexture

Static fromCanvas

  • fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number, origin?: string): BaseTexture
  • Parameters

    • canvas: HTMLCanvasElement
    • Optional scaleMode: number
    • Optional origin: string

    Returns BaseTexture

Static fromImage

  • fromImage(imageUrl: string, crossorigin?: boolean, scaleMode?: number, sourceScale?: number): BaseTexture
  • Parameters

    • imageUrl: string
    • Optional crossorigin: boolean
    • Optional scaleMode: number
    • Optional sourceScale: number

    Returns BaseTexture

Static removeFromCache

  • Parameters

    Returns BaseTexture

Generated using TypeDoc