Name | Type | Default | Description |
---|---|---|---|
source |
HTMLImageElement | string |
image source or URL |
|
options.autoLoad |
boolean | true |
optional
start loading process |
options.createBitmap |
boolean | true |
optional
whether its required to create a bitmap before upload defaults true |
options.crossorigin |
boolean | true |
optional
Load image using cross origin |
options.premultiplyAlpha |
boolean | true |
optional
Premultiply image alpha in bitmap |
Extends
Members
-
_height number protected inherited
-
Internal height of the resource
-
_width number protected inherited
-
Internal width of the resource
-
The ImageBitmap element created for HTMLImageElement
- Default Value:
- null
-
If capable, convert the image using createImageBitmap API
- Default Value:
- PIXI.settings.CREATE_IMAGE_BITMAP
-
destroyed boolean readonly inherited
-
If resource has been destroyed
- Default Value:
- false
-
height number readonly inherited
-
The height of the resource.
-
internal boolean protected inherited
-
true
if resource is created by BaseTexture useful for doing cleanup with BaseTexture destroy and not cleaning up resources that were created externally. -
Controls texture premultiplyAlpha field Copies from options
-
If the image should be disposed after upload
- Default Value:
- false
-
source HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement readonly inherited
-
The source element
-
URL of the image source
-
valid boolean readonly inherited
-
Has been validated
-
width number readonly inherited
-
The width of the resource.
Methods
-
bind (baseTexture) inherited
-
Bind to a parent BaseTexture
Name Type Description baseTexture
PIXI.BaseTexture Parent texture
-
destroy () inherited
-
Call when destroying resource, unbind any BaseTexture object before calling this method, as reference counts are maintained internally.
-
Clean up anything, this happens when destroying is ready.
-
load (createBitmap)Promise.<void> overrides
-
returns a promise when image will be loaded and processed
Name Type Default Description createBitmap
boolean true optional whether process image into bitmap
Returns:
Type Description Promise.<void> -
Called when we need to convert image into BitmapImage. Can be called multiple times, real promise is cached inside.
Returns:
Type Description Promise.<void> cached promise to fill that bitmap -
resize () inherited
-
Trigger a resize event
-
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 true
is success -
unbind (baseTexture) inherited
-
Unbind to a parent BaseTexture
Name Type Description baseTexture
PIXI.BaseTexture Parent texture
-
update () inherited
-
Has been updated trigger event
-
upload (renderer, baseTexture, glTexture)boolean overrides
-
Upload the image 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