Table of Contents

Class TextureUtils

Namespace
S1API.Rendering
Assembly
S1API.dll

Utility class for loading and creating textures at runtime.

public static class TextureUtils
Inheritance
TextureUtils
Inherited Members

Methods

LoadTextureFromBytes(byte[], FilterMode, TextureWrapMode)

Loads a texture from a byte array.

public static Texture2D LoadTextureFromBytes(byte[] imageData, FilterMode filterMode = 1, TextureWrapMode wrapMode = 1)

Parameters

imageData byte[]

The image data bytes.

filterMode FilterMode

The filter mode for the texture.

wrapMode TextureWrapMode

The wrap mode for the texture.

Returns

Texture2D

The loaded texture, or null if loading failed.

LoadTextureFromFile(string, FilterMode, TextureWrapMode)

Loads a texture from a file path.

public static Texture2D LoadTextureFromFile(string filePath, FilterMode filterMode = 1, TextureWrapMode wrapMode = 1)

Parameters

filePath string

The path to the image file.

filterMode FilterMode

The filter mode for the texture.

wrapMode TextureWrapMode

The wrap mode for the texture.

Returns

Texture2D

The loaded texture, or null if loading failed.

LoadTextureFromResource(Assembly, string, FilterMode, TextureWrapMode)

Loads a texture from an embedded resource.

public static Texture2D LoadTextureFromResource(Assembly assembly, string resourceName, FilterMode filterMode = 1, TextureWrapMode wrapMode = 1)

Parameters

assembly Assembly

The assembly containing the embedded resource.

resourceName string

The fully qualified name of the embedded resource.

filterMode FilterMode

The filter mode for the texture.

wrapMode TextureWrapMode

The wrap mode for the texture.

Returns

Texture2D

The loaded texture, or null if loading failed.