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).
| Depth |
Depth of a 3D texture in pixels, or slice count for 2D texture arrays, or 6 for slices of cubemap. |
| 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. |
| IsValid |
|
| 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. |
| Create |
Begins creation of a custom texture. Finish by calling Sandbox.Texture2DBuilder.Finish. |
| CreateArray |
Begins creation of a custom texture array. Finish by calling Sandbox.TextureArrayBuilder.Finish. |
| CreateCube |
Begins creation of a custom cube texture. (A texture with 6 sides) Finish by calling Sandbox.TextureCubeBuilder.Finish. |
| 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 |
Begins creation of a custom 3D texture. Finish by calling Sandbox.Texture3DBuilder.Finish. |
| Find |
Try to get an already loaded texture. |
| Loadobsolete |
Try to load a texture from given filesystem, by filename. |
| LoadAsyncobsolete |
Load a texture asynchronously. Will return when the texture is loaded and valid.
This is useful when loading textures from the web. |
| LoadAvatar |
Load avatar image of a Steam user (with a certain size if supplied). |
| LoadFromFileSystem |
Try to load a texture from given filesystem, by filename. |
| 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. |