Readonly
dimensionsThe dimensions of the texture
Until the texture data is loaded for the first time the value will be
null
.
Readonly
errorReadonly
lastReadonly
renderableReadonly
renderableReadonly
stateProtected
txStatic
z$__type__Get the CoreContextTexture for this Texture
Each Texture has a corresponding CoreContextTexture that is used to manage the texture's native data depending on the renderer's mode (WebGL, Canvas, etc).
The Texture and CoreContextTexture are always linked together in a 1:1 relationship.
Get the texture data for this texture.
The texture data for this texture.
This method is called by the CoreContextTexture when the texture is loaded. The texture data is then used to populate the CoreContextTexture.
Optional
onEvent called when the Texture becomes renderable or unrenderable.
true
if this Texture has renderable owners.
Used by subclasses like SubTexture propogate then renderability of the Texture to other referenced Textures.
Add/remove an owner to/from the Texture based on its renderability.
Any object can own a texture, be it a CoreNode or even the state object from a Text Renderer.
When the reference to the texture that an owner object holds is replaced
or cleared it must call this with renderable=false
to release the owner
association.
Set the state of the texture
Rest
...args: ParametersSkipTarget<TextureStateEventMap[State]>Intended for internal-use only but declared public so that it can be set by it's associated CoreContextTexture
Static
makeStatic
resolveResolve the default values for the texture's properties.
The default values for the texture's properties.
Each concrete Texture
subclass must implement this method to provide
default values for the texture's optional properties.
Generated using TypeDoc
Texture consisting of an image loaded from a URL
Remarks
The ImageTexture's ImageTextureProps.src prop defines the image URL to be downloaded.
By default, the texture's alpha values will be premultiplied into its color values which is generally the desired setting before they are sent to the texture's associated Shader. However, in special cases you may want the Shader to receive straight (non-premultiplied) values. In that case you can disable the default behavior by setting the ImageTextureProps.premultiplyAlpha prop to
false
.