API ReferenceSandbox.Resources

TextureGeneratorclass

objectResourceGenerator<T>TextureGenerator
Namespace
Sandbox.Resources
Assembly
Sandbox.Engine
Declaration
public abstract class Sandbox.Resources.TextureGenerator : Sandbox.Resources.ResourceGenerator<T>

Constructors1

Showing 1 constructors

Methods4

Showing 4 methods

public virtual sealed Sandbox.Texture Create(Sandbox.Resources.ResourceGenerator.Options options)PUBLICVIRTUAL

Create a texture. Will replace a placeholder texture, which will turn into the generated texture later, if it's not immediately available.

ParameterTypeDescription
optionsOptions
Returns:Texture

public virtual sealed System.Threading.Tasks.ValueTask`1<Sandbox.Texture> CreateAsync(Sandbox.Resources.ResourceGenerator.Options options, System.Threading.CancellationToken token)PUBLICVIRTUAL

Create a texture. Will wait until the texture is fully loaded and return when done.

ParameterTypeDescription
optionsOptions
tokenCancellationToken
Returns:ValueTask<Texture>

protected virtual System.Threading.Tasks.ValueTask`1<Sandbox.Texture> CreateTexture(Sandbox.Resources.ResourceGenerator.Options options, System.Threading.CancellationToken ct)PROTECTEDVIRTUAL

Find an existing texture for this

ParameterTypeDescription
optionsOptions
ctCancellationToken
Returns:ValueTask<Texture>

Properties1

Showing 1 properties

public virtual System.Nullable`1<Sandbox.ImageFormat> Sandbox.Resources.TextureGenerator.FormatOverride { get; set; }PUBLICVIRTUALGETSET

When set, the compiled texture will use this format instead of automatically determining one. Useful to avoid block compression (BC1/BC7) for textures that require pixel-perfect quality (sprites, UI, icons).

Returns:Nullable<ImageFormat>

On this page