PIXI.BaseImageResource
class BaseImageResource extends PIXI.Resource
Base for all the image/canvas resources.
Constructor
new PIXI.BaseImageResource(source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement) → {}
Name | Type | Description |
---|---|---|
source | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement |
Summary
Properties from BaseImageResource
HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement |
|
Methods from BaseImageResource
void |
|
void |
Destroy this BaseImageResource |
void |
|
boolean |
|
Properties inherited from Resource
boolean |
|
number |
|
boolean |
|
string |
The url of the resource |
boolean |
|
number |
|
number |
Internal height of the resource. |
number |
Internal width of the resource. |
Methods inherited from Resource
void |
|
void |
|
void |
|
boolean |
|
void |
|
Promise<PIXI.Resource> |
|
Public Properties
source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement
The source element.
Public Methods
static crossOrigin(element: HTMLImageElement | HTMLVideoElement, url: string, crossorigin: boolean | string) → {void}
Set cross origin based detecting the url and the crossorigin
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 |
Type | Description |
---|---|
void |
dispose() → {void}
Destroy this BaseImageResource
Type | Description |
---|---|
void |
update() → {void}
Checks if source width/height was changed, resize can cause extra baseTexture update. Triggers one update in any case.
Type | Description |
---|---|
void |
upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture, source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement) → {boolean}
Upload the texture to the GPU.
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) |
Type | Description |
---|---|
boolean |
|