Terraria ModLoader  0.10.1.5
A framework for 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

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.

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

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

+ Here is the caller graph for this function:

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  }
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 Terraria.ModLoader.ModUgBgStyle.mod
getset

The mod that added this underground background style.

Definition at line 13 of file ModBackgroundStyle.cs.

Referenced by Terraria.ModLoader.Mod.AddUgBgStyle(), and Terraria.ModLoader.Mod.AutoloadUgBgStyle().

string Terraria.ModLoader.ModUgBgStyle.Name
getset

The internal name of this underground background style.

Definition at line 21 of file ModBackgroundStyle.cs.

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

int Terraria.ModLoader.ModUgBgStyle.Slot
getset

The ID of this underground background style.

Definition at line 29 of file ModBackgroundStyle.cs.

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