class Texture : Resource

book_4_sparkGenerated
code_blocksInput

Description

A texture is an image used in rendering. It can be a static texture loaded from disk, or a dynamic texture rendered to by code. Textures can 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 or URL.
LoadAvatarLoads a Steam avatar texture by Steam ID.
LoadAsyncAsynchronously loads a texture from a file.
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 pixel data of the texture at a specified mip level.
GetBitmapGets a bitmap representation of the texture at a specified mip level.
GetPixels3DGets the 3D pixel data of the texture.
GetPixelGets the color of a specific pixel in the texture.
GetPixel3DGets the color of a specific pixel in a 3D texture.
UpdateUpdates the texture with new data.
Update3DUpdates a 3D texture with new data.
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.