Options
All
  • Public
  • Public/Protected
  • All
Menu

Base for all the image/canvas resources

memberof

PIXI

Hierarchy

Index

Constructors

constructor

Properties

Protected _height

_height: number

Protected _width

_width: number

destroyed

destroyed: boolean

internal

internal: boolean

noSubImage

noSubImage: boolean

Protected onError

onError: Runner

Protected onResize

onResize: Runner

Protected onUpdate

onUpdate: Runner

source

source: ImageSource

Accessors

height

  • get height(): number
  • The height of the resource.

    member

    {number}

    readonly

    Returns number

valid

  • get valid(): boolean
  • Has been validated

    readonly
    member

    {boolean}

    Returns boolean

width

  • get width(): number
  • The width of the resource.

    member

    {number}

    readonly

    Returns number

Methods

bind

destroy

  • destroy(): void
  • Call when destroying resource, unbind any BaseTexture object before calling this method, as reference counts are maintained internally.

    Returns void

dispose

  • dispose(): void
  • Destroy this BaseImageResource

    override

    Returns void

Protected load

  • This can be overridden to start preloading a resource or do any other prepare step.

    Returns Promise<Resource>

    Handle the validate event

resize

  • resize(width: number, height: number): void
  • Trigger a resize event

    Parameters

    • width: number

      X dimension

    • height: number

      Y dimension

    Returns void

style

unbind

update

  • update(): void
  • Checks if source width/height was changed, resize can cause extra baseTexture update. Triggers one update in any case.

    Returns void

upload

Static Protected crossOrigin

  • crossOrigin(element: HTMLImageElement | HTMLVideoElement, url: string, crossorigin?: string | boolean): void
  • Set cross origin based detecting the url and the crossorigin

    Parameters

    • element: HTMLImageElement | HTMLVideoElement

      Element to apply crossOrigin

    • url: string

      URL to check

    • Optional crossorigin: string | boolean

    Returns void

Static test

  • test(_source: unknown, _extension?: string): boolean
  • Abstract, used to auto-detect resource type

    static

    Parameters

    • _source: unknown
    • Optional _extension: string

    Returns boolean

Generated using TypeDoc