Name | Type | Default | Description |
---|---|---|---|
source |
HTMLImageElement | string |
image source or URL |
|
options.autoLoad |
boolean | true |
optional
start loading process |
options.createBitmap |
boolean | PIXI.settings.CREATE_IMAGE_BITMAP |
optional
whether its required to create a bitmap before upload |
options.crossorigin |
boolean | true |
optional
Load image using cross origin |
options.alphaMode |
PIXI.ALPHA_MODES | PIXI.ALPHA_MODES.UNPACK |
optional
Premultiply image alpha in bitmap |
Extends
Members
-
Internal height of the resource
-
Internal width of the resource
-
alphaMode PIXI.ALPHA_MODES | null readonly
-
Controls texture alphaMode field Copies from options Default is
null
, copies option from baseTexture -
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. -
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 (width, height) 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 true
is success -
unbind (baseTexture) inherited
-
Unbind to a parent BaseTexture
Name Type Description baseTexture
PIXI.BaseTexture Parent texture
-
update () inherited
-
Checks if source width/height was changed, resize can cause extra baseTexture update. Triggers one update in any case.
-
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