PIXI.CanvasResource

class CanvasResource extends PIXI.BaseImageResource

Resource type for HTMLCanvasElement.

Constructor


new PIXI.CanvasResource(source: HTMLCanvasElement) → {}
Parameters:
Name Type Description
source HTMLCanvasElement

Canvas element to use

Summary


Methods from CanvasResource

Properties inherited from BaseImageResource

HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement
source

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.

Methods inherited from BaseImageResource

void
dispose()

Destroy this BaseImageResource

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

Public Methods


test CanvasResource.ts:22
static test(source: unknown) → {boolean}

Used to auto-detect the type of resource.

Parameters:
Name Type Description
source unknown

The source object

Returns:
Type Description
boolean

true if source is HTMLCanvasElement or OffscreenCanvas


Powered by webdoc!