class Texture : Resource

robot_2Generated
code_blocksInput

Description

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).

Members

Static Members

Member NameSummary
CreateCustomBegins creation of a custom texture. Finish by calling TextureBuilder.Create.
CreateCreates a 2D texture with specified width, height, and format.
CreateVolumeCreates a 3D texture with specified width, height, depth, and format.
CreateCubeCreates a cube texture with specified width, height, and format.
CreateArrayCreates a texture array with specified width, height, count, and format.
CreateRenderTargetBegins creation of a render target. Finish by calling TextureBuilder.Create. Render targets can be used for advanced rendering techniques.
CreateFromSvgSourceCreates a texture from SVG source with optional width, height, and color.
LoadLoads a texture from a file system or URL, with an option to warn on missing files.
LoadAvatarLoads a Steam avatar texture by Steam ID.
LoadAsyncAsynchronously loads a texture from a file system with an option to warn on missing files.
FindFinds a texture by file path.
Invalid1x1 solid magenta colored texture.
White1x1 solid white opaque texture.
Transparent1x1 fully transparent texture.

Instance Members

Member NameSummary
DisposeReleases the handle for this texture. If the texture isn't referenced by anything else, it'll be released properly.
GetSequenceFrameCountGets the frame count of a sequence by its ID.
MarkUsedMarks the texture as used with a required mip size.
CreateGeneratorCreates and returns a generator for a generated texture.
GetPixelsGets the pixels of the texture at a specified mip level.
GetBitmapGets the bitmap of the texture at a specified mip level.
GetPixels3DGets the pixels of a 3D texture at a specified mip level.
GetPixelGets a single pixel color from the texture at specified coordinates and mip level.
GetPixel3DGets a single pixel color from a 3D texture at specified coordinates and mip level.
UpdateUpdates the texture with new data at specified coordinates and dimensions.
Update3DUpdates a 3D texture with new data at specified coordinates and dimensions.
IsErrorWhether this texture is an error or invalid.
IndexTexture index. Needs a higher level abstraction.
WidthWidth of the texture in pixels.
HeightHeight of the texture in pixels.
DepthDepth of a 3D texture in pixels, or slice count for 2D texture arrays, or 6 for slices of cubemap.
MipsNumber of mip maps this texture has.
SizeReturns a Vector2 representing the size of the texture (width, height).
IsLoadedWhether this texture has finished loading.
ImageFormatImage format of this texture.
LastUsedReturns how many frames ago this texture was last used by the renderer.
SequenceDataIf this texture is a sprite sheet, returns information about the sheet.
SequenceCountThe count of sequences in this texture, if any.
HasAnimatedSequencesIndicates if the texture has animated sequences.
GenerationDataData used by the generator to create the texture.