tModLoader v0.11.8.9
A mod to make and play Terraria mods
Terraria.ModLoader.ModUgBgStyle Class Referenceabstract

Each background style determines in its own way how exactly the background is drawn. This class serves as a collection of functions for underground backgrounds. More...

Public Member Functions

virtual bool Autoload (ref string name)
 Allows you to automatically add a ModUgBgStyle instead of using Mod.AddUgBgStyle. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name. Use this to either force or stop an autoload, or change the name that identifies this type of ModUgBgStyle. More...
 
virtual bool ChooseBgStyle ()
 Whether or not the conditions have been met for this background style to draw its backgrounds. Returns false by default. More...
 
abstract void FillTextureArray (int[] textureSlots)
 Allows you to determine which textures make up the background by assigning their background slots/IDs to the given array. Mod.GetBackgroundSlot may be useful here. Index 0 is the texture on the border of the ground and sky layers. Index 1 is the texture drawn between rock and ground layers. Index 2 is the texture on the border of ground and rock layers. Index 3 is the texture drawn in the rock layer. The border images are 160x16 pixels, and the others are 160x96, but it seems like the right 32 pixels of each is a duplicate of the far left 32 pixels. More...
 

Properties

Mod mod [get, set]
 The mod that added this underground background style. More...
 
string Name [get, set]
 The internal name of this underground background style. More...
 
int Slot [get, set]
 The ID of this underground background style. More...
 

Detailed Description

Each background style determines in its own way how exactly the background is drawn. This class serves as a collection of functions for underground backgrounds.

Definition at line 8 of file ModBackgroundStyle.cs.

Member Function Documentation

◆ Autoload()

virtual bool Terraria.ModLoader.ModUgBgStyle.Autoload ( ref string  name)
virtual

Allows you to automatically add a ModUgBgStyle instead of using Mod.AddUgBgStyle. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name. Use this to either force or stop an autoload, or change the name that identifies this type of ModUgBgStyle.

Definition at line 37 of file ModBackgroundStyle.cs.

37 {
38 return mod.Properties.Autoload;
39 }
ModProperties Properties
Definition: Mod.cs:52
Mod mod
The mod that added this underground background style.
bool Autoload
Whether or not this mod will autoload content by default. Autoloading content means you do not need t...

References Terraria.ModLoader.ModProperties.Autoload, Terraria.ModLoader.ModUgBgStyle.mod, and Terraria.ModLoader.Mod.Properties.

Referenced by Terraria.ModLoader.Mod.AutoloadUgBgStyle().

+ Here is the caller graph for this function:

◆ ChooseBgStyle()

virtual bool Terraria.ModLoader.ModUgBgStyle.ChooseBgStyle ( )
virtual

Whether or not the conditions have been met for this background style to draw its backgrounds. Returns false by default.

Definition at line 44 of file ModBackgroundStyle.cs.

44 {
45 return false;
46 }

◆ FillTextureArray()

abstract void Terraria.ModLoader.ModUgBgStyle.FillTextureArray ( int[]  textureSlots)
pure virtual

Allows you to determine which textures make up the background by assigning their background slots/IDs to the given array. Mod.GetBackgroundSlot may be useful here. Index 0 is the texture on the border of the ground and sky layers. Index 1 is the texture drawn between rock and ground layers. Index 2 is the texture on the border of ground and rock layers. Index 3 is the texture drawn in the rock layer. The border images are 160x16 pixels, and the others are 160x96, but it seems like the right 32 pixels of each is a duplicate of the far left 32 pixels.

Property Documentation

◆ mod

Mod Terraria.ModLoader.ModUgBgStyle.mod
getset

The mod that added this underground background style.

Definition at line 13 of file ModBackgroundStyle.cs.

13 {
14 get;
15 internal set;
16 }

Referenced by Terraria.ModLoader.ModUgBgStyle.Autoload().

◆ Name

string Terraria.ModLoader.ModUgBgStyle.Name
getset

The internal name of this underground background style.

Definition at line 21 of file ModBackgroundStyle.cs.

21 {
22 get;
23 internal set;
24 }

Referenced by Terraria.ModLoader.Mod.AutoloadUgBgStyle().

◆ Slot

int Terraria.ModLoader.ModUgBgStyle.Slot
getset

The ID of this underground background style.

Definition at line 29 of file ModBackgroundStyle.cs.

29 {
30 get;
31 internal set;
32 }