Skip to content

Texture

extends AssetObject

The Texture class is a base class for handling textures.

typescript
    let uuid = "31A9092E126B4B19BBFD9D5FCD75AA49";
    let tex = Resources.Load<Texture>(Texture, uuid);
    if (tex == null) {
        throw new Exception("failed to load texture2d: " + uuid);
    }

Instance Properties

Texture.isReadable : boolean
(Read Only) Whether the texture is readable.
Texture.dimension : TextureDimension
(Read Only) The dimension type of the texture.
Texture.width : number
The width of the texture in pixels.
Texture.height : number
(Read Only) The height of the texture in pixels.
Texture.filterMode : FilterMode
The filtering mode of the texture.
Texture.mipmapCount : number
(Read Only) The number of Mipmap levels in the texture.
Texture.texelSize : Vector2
The size of each pixel in the texture.
Texture.graphicFormat : GraphicsFormat
(Read Only) The pixel format of the current texture.
Texture.anisoLevel : AnisoLevel
The anisotropic filtering level of the texture.
Texture.mipmapBias : number
The Mipmap bias of the texture.
Texture.wrapMode : TextureWrapMode
The texture coordinate wrap mode of the texture.
Texture.wrapModeU : TextureWrapMode
The wrap mode of the texture's U coordinate.
Texture.wrapModeV : TextureWrapMode
The wrap mode of the texture's V coordinate.
Texture.wrapModeW : TextureWrapMode
The wrap mode of the texture's W coordinate.
Texture.isCrash : boolean
(Read Only) Whether the current texture has encountered an exception.

Instance Method

Texture.GenerateMipmaps ( ) : boolean
Generate mipmap.
Texture.ReleaseMipmaps ( ) : void
Release mipmap.