new PIXI.ImageBitmapResource (source, options) overrides
Name | Type | Attributes | Description |
---|---|---|---|
source |
ImageBitmap | string |
ImageBitmap or URL to use. |
|
options |
PIXI.IImageBitmapResourceOptions |
<optional> |
Options to use. |
Extends
Members
alphaMode PIXI.ALPHA_MODES | null readonly
Controls texture alphaMode field
Copies from options
Default is null
, copies option from baseTexture
Load image using cross origin.
- Default Value:
- false
URL of the image source.
Methods
Used to auto-detect the type of resource.
Name | Type | Description |
---|---|---|
source |
unknown |
The source object |
Returns:
Type | Description |
---|---|
boolean | true if current environment support ImageBitmap, and source is string or ImageBitmap |
dispose () void overrides
Destroys this resource.
upload (renderer, baseTexture, glTexture) boolean overrides
Upload the image bitmap resource to GPU.
Name | Type | Description |
---|---|---|
renderer |
PIXI.Renderer |
Renderer to upload to |
baseTexture |
PIXI.BaseTexture |
BaseTexture for this resource |
glTexture |
PIXI.GLTexture |
GLTexture to use |
Returns:
Type | Description |
---|---|
boolean | true is success |
Inherited Properties
From class PIXI.BaseImageResource
source PIXI.ImageSourcee readonly inherited
The source element.
From class PIXI.Resource
destroyed boolean readonly inherited
If resource has been destroyed.
- Default Value:
- false
height number readonly inherited
The height of the resource.
internal boolean inherited
true
if resource is created by BaseTexture
useful for doing cleanup with BaseTexture destroy
and not cleaning up resources that were created
externally.
src string inherited
The url of the resource
valid boolean readonly inherited
Has been validated
width number readonly inherited
The width of the resource.
_height number protected inherited
Internal height of the resource.
_width number protected inherited
Internal width of the resource.
Inherited Methods
From class PIXI.BaseImageResource
update () void inherited
Checks if source width/height was changed, resize can cause extra baseTexture update. Triggers one update in any case.
From class PIXI.Resource
bind (baseTexture) void inherited
Bind to a parent BaseTexture
Name | Type | Description |
---|---|---|
baseTexture |
PIXI.BaseTexture |
Parent texture |
destroy () void inherited
Call when destroying resource, unbind any BaseTexture object before calling this method, as reference counts are maintained internally.
resize (width, height) void inherited
Trigger a resize event
Name | Type | Description |
---|---|---|
width |
number |
X dimension |
height |
number |
Y dimension |
style (_renderer, _baseTexture, _glTexture) boolean inherited
Set the style, optional to override
Name | Type | Description |
---|---|---|
_renderer |
PIXI.Renderer |
yeah, renderer! |
_baseTexture |
PIXI.BaseTexture |
the texture |
_glTexture |
PIXI.GLTexture |
texture instance for this webgl context |
Returns:
Type | Description |
---|---|
boolean |
|
unbind (baseTexture) void inherited
Unbind to a parent BaseTexture
Name | Type | Description |
---|---|---|
baseTexture |
PIXI.BaseTexture |
Parent texture |
load () Promise<this> protected inherited
This can be overridden to start preloading a resource or do any other prepare step.
Returns:
Type | Description |
---|---|
Promise<this> | Handle the validate event |