class Texture : Resource

book_4_sparkGenerated
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.
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 not referenced elsewhere, it will be released properly.
GetSequenceFrameCountGets the frame count for a sequence by ID.
MarkUsedMarks the texture as used with a required mip size.
CreateGeneratorCreates and returns a generator for a generated texture.
GetPixelsGets the pixel data for a specified mip level.
GetBitmapGets a bitmap representation of the texture for a specified mip level.
GetPixels3DGets the 3D pixel data for a specified mip level.
GetPixelGets the color of a specific pixel at given coordinates and mip level.
GetPixel3DGets the color of a specific 3D pixel at given 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.

Properties

Property NameSummary
IsErrorIndicates whether 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).
IsLoadedIndicates whether 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.