Table of Contents

Class TextureLoader

Namespace
MagicUI.Graphics
Assembly
MagicUI.dll

Streamlines loading textures embedded in your assembly for usage with UI elements, such as buttons, borders, or images

public class TextureLoader
Inheritance
TextureLoader
Inherited Members

Constructors

TextureLoader(Assembly, string)

Creates a texture loader for a given namespace

public TextureLoader(Assembly asm, string resourceNamespace)

Parameters

asm Assembly

The assembly to load from

resourceNamespace string

The namespace to load the resource from

Methods

DisposeTexture(string)

Cleans up the texture with the given file name if it is loaded

public void DisposeTexture(string name)

Parameters

name string

The filename of the image to dispose

GetTexture(string)

Gets the texture for the given file name, loading it first if needed

public Texture2D GetTexture(string name)

Parameters

name string

The filename of the image to load

Returns

Texture2D

The loaded texture

Preload()

Preloads all textures in this loader's namespace

public void Preload()