Summary

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

Properties

Depth Depth of a 3D texture in pixels, or slice count for 2D texture arrays, or 6 for slices of cubemap.
GenerationData Data used by the generator to create the texture
HasAnimatedSequences
Height Height of the texture in pixels.
ImageFormat Image format of this texture.
Index Texture index. Bit raw dog and needs a higher level abstraction.
IsError Whether this texture is an error or invalid or not.
IsLoaded Whether this texture has finished loading or not.
LastUsed Returns how many frames ago this texture was last used by the renderer
Mips Number of mip maps this texture has.
SequenceCount The count of sequences in this texture, if any. The rest of the sequence data is encoded into the texture itself.
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 Returns a Vector2 representing the size of the texture (width, height)
Width Width of the texture in pixels.

Methods

CreateGenerator If this is a generated texture we'll create and return a generator for it.
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.
GetBitmap
GetPixel
GetPixel3D
GetPixels
GetPixels3D
GetSequenceFrameCount
MarkUsed
Update
Update3D

Static Properties

Invalid 1x1 solid magenta colored texture.
Transparent 1x1 fully transparent texture.
White 1x1 solid white opaque texture.

Static Methods

Create
CreateArray
CreateCube
CreateCustom Begins creation of a custom texture. Finish by calling Sandbox.TextureBuilder.Create(System.String,System.Boolean,System.ReadOnlySpan{System.Byte},System.Int32).
CreateFromSvgSource
CreateRenderTarget Begins creation of a render target. Finish by calling Sandbox.TextureBuilder.Create(System.String,System.Boolean,System.ReadOnlySpan{System.Byte},System.Int32).
CreateVolume
Find
Load
LoadAsync
LoadAvatar
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.