tModLoader v2023.10
A mod to make and play Terraria mods
BackgroundTextureLoader Class Reference

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

Inherits Loader.

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.
 

Detailed Description

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

Member Function Documentation

◆ AddBackgroundTexture()

static void 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.