tModLoader  0.12 Alpha
A mod to make and play Terraria mods
Terraria.ModLoader.BackgroundTextureLoader Class Reference

This is the class that keeps track of all modded background textures and their slots/IDs. More...

Inherits Terraria.ModLoader.Loader< T >.

Static Public Member Functions

static void AddBackgroundTexture (Mod mod, string texture)
 Adds a texture to the list of background textures and assigns it a background texture slot. More...
 
static int GetBackgroundSlot (string texture)
 Returns the slot/ID of the background texture with the given name. Throws exceptions on failure. More...
 
static bool TryGetBackgroundSlot (string texture, out int slot)
 Safely attempts to output the slot/ID of the background texture with the given name. More...
 

Static Public Attributes

const int VanillaBackgroundTextureCount = Main.maxBackgrounds
 

Additional Inherited Members

- Public Member Functions inherited from Terraria.ModLoader.Loader< T >
Get (int id)
 
int Register (T obj)
 
- Protected Member Functions inherited from Terraria.ModLoader.Loader< T >
int Reserve ()
 
- Properties inherited from Terraria.ModLoader.Loader< T >
int VanillaCount [get, set]
 

Detailed Description

This is the class that keeps track of all modded background textures and their slots/IDs.

Member Function Documentation

◆ AddBackgroundTexture()

static void Terraria.ModLoader.BackgroundTextureLoader.AddBackgroundTexture ( Mod  mod,
string  texture 
)
static

Adds a texture to the list of background textures and assigns it a background texture slot.

Parameters
textureThe texture.

◆ GetBackgroundSlot()

static int Terraria.ModLoader.BackgroundTextureLoader.GetBackgroundSlot ( string  texture)
static

Returns the slot/ID of the background texture with the given name. Throws exceptions on failure.

◆ TryGetBackgroundSlot()

static bool Terraria.ModLoader.BackgroundTextureLoader.TryGetBackgroundSlot ( string  texture,
out int  slot 
)
static

Safely attempts to output the slot/ID of the background texture with the given name.