PIXI.BaseImageResource

class BaseImageResource extends PIXI.Resource

Base for all the image/canvas resources.

Constructor


new PIXI.BaseImageResource(source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement) → {}
Parameters:
Name Type Description
source HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement

Summary


Properties from BaseImageResource

HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement
source

Methods from BaseImageResource

void
static crossOrigin(element: HTMLImageElement | HTMLVideoElement, url: string, crossorigin: boolean | string)
void
dispose()

Destroy this BaseImageResource

void
update()
boolean
upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture, source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement)

Properties inherited from Resource

boolean
destroyed = false
number
height
boolean
internal
string
src

The url of the resource

boolean
valid
number
width
number
protected _height

Internal height of the resource.

number
protected _width

Internal width of the resource.

Public Properties


source BaseImageResource.ts:15
source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement

The source element.

Public Methods


crossOrigin BaseImageResource.ts:45
static crossOrigin(element: HTMLImageElement | HTMLVideoElement, url: string, crossorigin: boolean | string) → {void}

Set cross origin based detecting the url and the crossorigin

Parameters:
Name Type Attributes Description
element HTMLImageElement | HTMLVideoElement

Element to apply crossOrigin

url string

URL to check

crossorigin boolean | string

<optional>

Cross origin value to use

Returns:
Type Description
void
dispose BaseImageResource.ts:135
dispose() → {void}

Destroy this BaseImageResource

Returns:
Type Description
void
update BaseImageResource.ts:114
update() → {void}

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

Returns:
Type Description
void
upload BaseImageResource.ts:63
upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture, source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement) → {boolean}

Upload the texture to the GPU.

Parameters:
Name Type Attributes Description
renderer PIXI.Renderer

Upload to the renderer

baseTexture PIXI.BaseTexture

Reference to parent texture

glTexture PIXI.GLTexture
source HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement

<optional>

(optional)

Returns:
Type Description
boolean
  • true is success

Powered by webdoc!