Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
object |
<optional> |
||
options.width |
number |
<optional> |
100 |
The width of the base render texture. |
options.height |
number |
<optional> |
100 |
The height of the base render texture. |
options.scaleMode |
PIXI.SCALE_MODES |
<optional> |
See PIXI.SCALE_MODES for possible values. |
|
options.resolution |
number |
<optional> |
1 |
The resolution / device pixel ratio of the texture being generated. |
Extends
Members
The data structure for the filters.
maskStack Array<PIXI.MaskData>
The data structure for the stencil masks.
_canvasRenderTarget PIXI.utils.CanvasRenderTarget protected
A reference to the canvas render target (we only need one as this can be shared across renderers)
Methods
destroy () void overrides
Destroys this texture.
dispose () void overrides
Frees the texture and framebuffer from WebGL memory without destroying this texture object. This means you can still use the texture later which will upload it to GPU memory again.
Fires:
- PIXI.BaseTexture#dispose
Resizes the BaseRenderTexture.
Name | Type | Description |
---|---|---|
width |
number |
The width to resize to. |
height |
number |
The height to resize to. |
Inherited Properties
From class PIXI.BaseTexture
_batchEnabled number inherited
Number of the texture batch, used by multi-texture renderers
_batchLocation number inherited
Location inside texture batch, used by multi-texture renderers
_id number Deprecated : since 5.2.0 inherited
Batch local field, stores current texture location
- See:
-
- PIXI.BaseTexture#_batchLocation
alphaMode PIXI.ALPHA_MODES inherited
How to treat premultiplied alpha, see PIXI.ALPHA_MODES.
- Default Value:
- PIXI.ALPHA_MODES.UNPACK
anisotropicLevel number inherited
Anisotropic filtering level of texture
- Default Value:
- PIXI.settings.ANISOTROPIC_LEVEL
cacheId string inherited
Currently default cache ID.
destroyed boolean inherited
Flag if BaseTexture has been destroyed.
dirtyId number inherited
Used by TextureSystem to only update texture to the GPU when needed.
Please call update()
to increment it.
format PIXI.FORMATS inherited
The pixel format of the texture
- Default Value:
- PIXI.FORMATS.RGBA
hasLoaded boolean Deprecated : since 5.0.0 inherited
- See:
-
- PIXI.BaseTexture#valid
height number inherited
The height of the base texture set when the image has loaded
imageUrl string Deprecated : since 5.0.0 inherited
- See:
-
- PIXI.ImageResource#url
isPowerOfTwo boolean inherited
Whether or not the texture is a power of two, try to use power of two textures as much as you can
- Default Value:
- false
mipmap PIXI.MIPMAP_MODES inherited
Mipmap mode of the texture, affects downscaled images
- Default Value:
- PIXI.settings.MIPMAP_TEXTURES
parentTextureArray PIXI.BaseTexture inherited
Whether its a part of another texture, handled by ArrayResource or CubeResource
premultiplyAlpha boolean Deprecated : since 5.2.0 inherited
- See:
-
- PIXI.BaseTexture#alphaMode
realHeight number inherited
Pixel height of the source of this texture
realWidth number inherited
Pixel width of the source of this texture
resolution number inherited
The resolution / device pixel ratio of the texture
- Default Value:
- PIXI.settings.RESOLUTION
resource PIXI.Resource inherited
The resource used by this BaseTexture, there can only be one resource per BaseTexture, but textures can share resources.
scaleMode PIXI.SCALE_MODES inherited
The scale mode to apply when scaling this texture
- Default Value:
- PIXI.settings.SCALE_MODE
source HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement Deprecated : since 5.0.0 inherited
- See:
-
- PIXI.BaseImageResource#source
target PIXI.TARGETS inherited
The target type
- Default Value:
- PIXI.TARGETS.TEXTURE_2D
textureCacheIds
Array
inherited
The collection of alternative cache ids, since some BaseTextures can have more than one ID, short name and longer full URL
type PIXI.TYPES inherited
The type of resource data
- Default Value:
- PIXI.TYPES.UNSIGNED_BYTE
valid boolean inherited
Generally speaking means when resource is loaded.
width number inherited
The width of the base texture set when the image has loaded
wrapMode number inherited
How the texture wraps
dirtyStyleId number protected inherited
Used by TextureSystem to only update texture style when needed.
touched number protected inherited
Used by automatic texture Garbage Collection, stores last GC tick when it was bound
uid number protected inherited
Global unique identifier for this BaseTexture
Inherited Methods
From class PIXI.BaseTexture
castToBaseTexture () PIXI.BaseTexture inherited
Utility function for BaseTexture|Texture cast
Returns:
Type | Description |
---|---|
PIXI.BaseTexture |
getDrawableSource () PIXI.ICanvasImageSource inherited
Get the drawable source, such as HTMLCanvasElement or HTMLImageElement suitable for rendering with CanvasRenderer. Provided by @pixi/canvas-renderer package.
Returns:
Type | Description |
---|---|
PIXI.ICanvasImageSource | Source to render with CanvasRenderer |
loadSource (image) void Deprecated`` : since 5.0.0 inherited
Name | Type | Description |
---|---|---|
image |
string | HTMLImageElement |
setRealSize (realWidth, realHeight, resolution) PIXI.BaseTexture inherited
Sets real size of baseTexture, preserves current resolution.
Name | Type | Attributes | Description |
---|---|---|---|
realWidth |
number |
Full rendered width |
|
realHeight |
number |
Full rendered height |
|
resolution |
number |
<optional> |
Optionally set resolution |
Returns:
Type | Description |
---|---|
PIXI.BaseTexture | this |
setResolution (resolution) PIXI.BaseTexture inherited
Changes resolution
Name | Type | Description |
---|---|---|
resolution |
number |
res |
Returns:
Type | Description |
---|---|
PIXI.BaseTexture | this |
setResource (resource) PIXI.BaseTexture inherited
Sets the resource if it wasn't set. Throws error if resource already present
Name | Type | Description |
---|---|---|
resource |
PIXI.Resource |
that is managing this BaseTexture |
Returns:
Type | Description |
---|---|
PIXI.BaseTexture | this |
setSize (width, height, resolution) PIXI.BaseTexture inherited
Changes w/h/resolution. Texture becomes valid if width and height are greater than zero.
Name | Type | Attributes | Description |
---|---|---|---|
width |
number |
Visual width |
|
height |
number |
Visual height |
|
resolution |
number |
<optional> |
Optionally set resolution |
Returns:
Type | Description |
---|---|
PIXI.BaseTexture | this |
setStyle (scaleMode, mipmap) PIXI.BaseTexture inherited
Changes style options of BaseTexture
Name | Type | Attributes | Description |
---|---|---|---|
scaleMode |
PIXI.SCALE_MODES |
<optional> |
Pixi scalemode |
mipmap |
PIXI.MIPMAP_MODES |
<optional> |
enable mipmaps |
Returns:
Type | Description |
---|---|
PIXI.BaseTexture | this |
update () void inherited
Invalidates the object. Texture becomes valid if width and height are greater than zero.
Inherited Events
From class PIXI.BaseTexture
error inherited
Fired when a not-immediately-available source fails to load.
Name | Type | Description |
---|---|---|
baseTexture |
PIXI.BaseTexture |
Resource errored. |
event |
ErrorEvent |
Load error event. |
loaded inherited
Fired when a not-immediately-available source finishes loading.
Name | Type | Description |
---|---|---|
baseTexture |
PIXI.BaseTexture |
Resource loaded. |