Class BaseImageResource

Base for all the image/canvas resources.

Memberof

PIXI

Hierarchy (view full)

Constructors

Properties

destroyed: boolean

If resource has been destroyed.

Default

false
internal: boolean

true if resource is created by BaseTexture useful for doing cleanup with BaseTexture destroy and not cleaning up resources that were created externally.

source: ImageSource

The source element.

Member

src: string

The url of the resource

Accessors

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

    Returns number

  • get valid(): boolean
  • Has been validated

    Returns boolean

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

    Returns number

Methods

  • Bind to a parent BaseTexture

    Parameters

    Returns void

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

    Returns void

  • Destroy this PIXI.BaseImageResource

    Returns void

  • Trigger a resize event

    Parameters

    • width: number

      X dimension

    • height: number

      Y dimension

    Returns void

  • Set the style, optional to override

    Parameters

    Returns boolean

    • true is success
  • Checks if source width/height was changed, resize can cause extra baseTexture update. Triggers one update in any case.

    Returns void

  • Upload the texture to the GPU.

    Parameters

    Returns boolean

    • true is success
  • 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

      Cross origin value to use

    Returns void

  • Abstract, used to auto-detect resource type.

    Parameters

    • _source: unknown

      The source object

    • Optional _extension: string

      The extension of source, if set

    Returns boolean

Generated using TypeDoc