Class TextureLoader
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
asmAssemblyThe assembly to load from
resourceNamespacestringThe 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
namestringThe 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
namestringThe filename of the image to load
Returns
- Texture2D
The loaded texture
Preload()
Preloads all textures in this loader's namespace
public void Preload()