# Sandbox.Texture

A texture is an image used in rendering. Can be a static texture loaded from disk, or a dynamic texture rendered to by code.
Can also be 2D, 3D (multiple slices), or a cube texture (6 slices).

- Kind: class
- Namespace: `Sandbox`
- Assembly: `Sandbox.Engine`
- Inherits: [Sandbox.Resource](/api/Sandbox.Resource)

## Properties

- [`Black`](/api/Sandbox.Texture/Black): 1x1 solid black opaque texture.
- [`Depth`](/api/Sandbox.Texture/Depth): Depth of a 3D texture in pixels, or slice count for 2D texture arrays, or 6 for slices of cubemap.
- [`Flags`](/api/Sandbox.Texture/Flags): Flags providing hints about this texture
- [`HasAnimatedSequences`](/api/Sandbox.Texture/HasAnimatedSequences)
- [`Height`](/api/Sandbox.Texture/Height): Height of the texture in pixels.
- [`ImageFormat`](/api/Sandbox.Texture/ImageFormat): Image format of this texture.
- [`Index`](/api/Sandbox.Texture/Index): Texture index. Bit raw dog and needs a higher level abstraction.
- [`Invalid`](/api/Sandbox.Texture/Invalid): 1x1 solid magenta colored texture.
- [`IsAnimated`](/api/Sandbox.Texture/IsAnimated): True if this is a multi-frame animated image (GIF, animated WebP) driven by `M:Sandbox.Texture.Tick`.
- [`IsError`](/api/Sandbox.Texture/IsError): Whether this texture is an error or invalid or not.
- [`IsLoaded`](/api/Sandbox.Texture/IsLoaded): Whether this texture has finished loading or not.
- [`IsValid`](/api/Sandbox.Texture/IsValid)
- [`LastUsed`](/api/Sandbox.Texture/LastUsed): Returns how many frames ago this texture was last used by the renderer
- [`Mips`](/api/Sandbox.Texture/Mips): Number of mip maps this texture has.
- [`SequenceCount`](/api/Sandbox.Texture/SequenceCount): The count of sequences in this texture, if any. The rest of the sequence data is encoded into the texture itself.
- [`SequenceData`](/api/Sandbox.Texture/SequenceData): If this texture is a sprite sheet, will return information about the sheet, which is generally used in the shader. You don't really need to think about the contents.
- [`Size`](/api/Sandbox.Texture/Size): Returns a Vector2 representing the size of the texture (width, height)
- [`Transparent`](/api/Sandbox.Texture/Transparent): 1x1 fully transparent texture.
- [`UAVAccess`](/api/Sandbox.Texture/UAVAccess): Gets if the texture has UAV access
- [`White`](/api/Sandbox.Texture/White): 1x1 solid white opaque texture.
- [`Width`](/api/Sandbox.Texture/Width): Width of the texture in pixels.

## Methods

- [`Clear`](/api/Sandbox.Texture/Clear): Clear this texture with a solid color
- [`Create`](/api/Sandbox.Texture/Create): Begins creation of a custom texture. Finish by calling [Sandbox.Texture2DBuilder.Finish](/api/Sandbox.Texture2DBuilder/Finish).
- [`CreateArray`](/api/Sandbox.Texture/CreateArray): Begins creation of a custom texture array. Finish by calling [Sandbox.TextureArrayBuilder.Finish](/api/Sandbox.TextureArrayBuilder/Finish).
- [`CreateCube`](/api/Sandbox.Texture/CreateCube): Begins creation of a custom cube texture. (A texture with 6 sides) Finish by calling [Sandbox.TextureCubeBuilder.Finish](/api/Sandbox.TextureCubeBuilder/Finish).
- [`CreateCustom`](/api/Sandbox.Texture/CreateCustom): Begins creation of a custom texture. Finish by calling `M:Sandbox.TextureBuilder.Create(System.String,System.Boolean,System.ReadOnlySpan{System.Byte},System.Int32)`.
- [`CreateFromSvgSource`](/api/Sandbox.Texture/CreateFromSvgSource)
- [`CreateRenderTarget`](/api/Sandbox.Texture/CreateRenderTarget): Begins creation of a render target. Finish by calling `M:Sandbox.TextureBuilder.Create(System.String,System.Boolean,System.ReadOnlySpan{System.Byte},System.Int32)`.
- [`CreateVolume`](/api/Sandbox.Texture/CreateVolume): Begins creation of a custom 3D texture. Finish by calling [Sandbox.Texture3DBuilder.Finish](/api/Sandbox.Texture3DBuilder/Finish).
- [`Dispose`](/api/Sandbox.Texture/Dispose): Will release the handle for this texture. If the texture isn't referenced by anything else it'll be released properly. This will happen anyway because it's called in the destructor. By calling it manually you're just telling the engine you're done with this texture right now instead of waiting for the garbage collector.
- [`Find`](/api/Sandbox.Texture/Find): Try to get an already loaded texture.
- [`GetBitmap`](/api/Sandbox.Texture/GetBitmap)
- [`GetBitmapAsync`](/api/Sandbox.Texture/GetBitmapAsync)
- [`GetPixel`](/api/Sandbox.Texture/GetPixel): Reads a single pixel color.
- [`GetPixel3D`](/api/Sandbox.Texture/GetPixel3D): Reads a single pixel color from a volume or array texture.
- [`GetPixels`](/api/Sandbox.Texture/GetPixels): Reads pixel colors from the texture at the specified mip level
- [`GetPixels3D`](/api/Sandbox.Texture/GetPixels3D)
- [`GetPixelsAsync`](/api/Sandbox.Texture/GetPixelsAsync)
- [`GetPixelsAsync3D`](/api/Sandbox.Texture/GetPixelsAsync3D)
- [`GetSequenceFrameCount`](/api/Sandbox.Texture/GetSequenceFrameCount): Get the frame count for this sequence
- [`Load`](/api/Sandbox.Texture/Load): Try to load a texture from given filesystem, by filename.
- [`LoadAsync`](/api/Sandbox.Texture/LoadAsync): Load a texture asynchronously. Will return when the texture is loaded and valid. This is useful when loading textures from the web.
- [`LoadAvatar`](/api/Sandbox.Texture/LoadAvatar): Load avatar image of a Steam user (with a certain size if supplied).
- [`LoadFromFileSystem`](/api/Sandbox.Texture/LoadFromFileSystem): Try to load a texture from given filesystem, by filename.
- [`LoadFromFileSystemAsync`](/api/Sandbox.Texture/LoadFromFileSystemAsync): Load a texture asynchronously. Will return when the texture is loaded and valid. This is useful when loading textures from the web, or without any big loading hitches.
- [`MarkUsed`](/api/Sandbox.Texture/MarkUsed): Tells texture streaming this texture is being used. This is usually automatic, but useful for bindless pipelines.
- [`SaveToVtex`](/api/Sandbox.Texture/SaveToVtex)
- [`SaveToVtexAsync`](/api/Sandbox.Texture/SaveToVtexAsync)
- [`Update`](/api/Sandbox.Texture/Update)
- [`Update3D`](/api/Sandbox.Texture/Update3D)
