tModLoader v2023.01
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 (Mod mod, string texture)
 Returns the slot/ID of the background texture with the given mod and path. Throws exceptions on failure.
 
static int GetBackgroundSlot (string texture)
 Returns the slot/ID of the background texture with the given full path. The path must be prefixed with a mod name. Throws exceptions on failure.
 
static bool TryGetBackgroundSlot (Mod mod, string texture, out int slot)
 Safely attempts to output the slot/ID of the background texture with the given mod and path.
 
static bool TryGetBackgroundSlot (string texture, out int slot)
 Safely attempts to output the slot/ID of the background texture with the given full path. The path must be prefixed with a mod name.
 

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
modThe mod that owns this background.
textureThe texture.