tModLoader v0.11.8.9
A mod to make and play Terraria mods
ModBackgroundStyle.cs
Go to the documentation of this file.
1using Microsoft.Xna.Framework.Graphics;
2
3namespace Terraria.ModLoader
4{
8 public abstract class ModUgBgStyle
9 {
13 public Mod mod {
14 get;
15 internal set;
16 }
17
21 public string Name {
22 get;
23 internal set;
24 }
25
29 public int Slot {
30 get;
31 internal set;
32 }
33
37 public virtual bool Autoload(ref string name) {
38 return mod.Properties.Autoload;
39 }
40
44 public virtual bool ChooseBgStyle() {
45 return false;
46 }
47
51 public abstract void FillTextureArray(int[] textureSlots);
52 }
53
57 public abstract class ModSurfaceBgStyle
58 {
62 public Mod mod {
63 get;
64 internal set;
65 }
66
70 public string Name {
71 get;
72 internal set;
73 }
74
78 public int Slot {
79 get;
80 internal set;
81 }
82
86 public virtual bool Autoload(ref string name) {
87 return mod.Properties.Autoload;
88 }
89
93 public virtual bool ChooseBgStyle() {
94 return false;
95 }
96
100 public abstract void ModifyFarFades(float[] fades, float transitionSpeed);
101
105 public virtual int ChooseFarTexture() {
106 return -1;
107 }
108
112 public virtual int ChooseMiddleTexture() {
113 return -1;
114 }
115
119 public virtual bool PreDrawCloseBackground(SpriteBatch spriteBatch) {
120 return true;
121 }
122
131 public virtual int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b) {
132 return -1;
133 }
134 }
135
139 public class GlobalBgStyle
140 {
144 public Mod mod {
145 get;
146 internal set;
147 }
148
152 public string Name {
153 get;
154 internal set;
155 }
156
160 public virtual bool Autoload(ref string name) {
161 return mod.Properties.Autoload;
162 }
163
167 public virtual void ChooseUgBgStyle(ref int style) {
168 }
169
173 public virtual void ChooseSurfaceBgStyle(ref int style) {
174 }
175
179 public virtual void FillUgTextureArray(int style, int[] textureSlots) {
180 }
181
185 public virtual void ModifyFarSurfaceFades(int style, float[] fades, float transitionSpeed) {
186 }
187 }
188}
This class serves to collect functions that operate on any kind of background style,...
string Name
The internal name of this global background style.
virtual void ChooseUgBgStyle(ref int style)
Allows you to change which underground background style is being used.
virtual bool Autoload(ref string name)
Allows you to automatically add a GlobalBgStyle instead of using Mod.AddGlobalBgStyle....
Mod mod
That mod that added this global background style.
virtual void FillUgTextureArray(int style, int[] textureSlots)
Allows you to change which textures make up the underground background by assigning their background ...
virtual void ModifyFarSurfaceFades(int style, float[] fades, float transitionSpeed)
Allows you to modify the transparency of all background styles that exist. The style parameter is the...
virtual void ChooseSurfaceBgStyle(ref int style)
Allows you to change which surface background style is being used.
Mod is an abstract class that you will override. It serves as a central place from which the mod's co...
Definition: Mod.cs:25
ModProperties Properties
Definition: Mod.cs:52
Each background style determines in its own way how exactly the background is drawn....
abstract void ModifyFarFades(float[] fades, float transitionSpeed)
Allows you to modify the transparency of all background styles that exist. In general,...
virtual bool Autoload(ref string name)
Allows you to automatically add a ModSurfaceBgStyle instead of using Mod.AddSurfaceBgStyle....
Mod mod
The mod that added this surface background style.
virtual int ChooseMiddleTexture()
Allows you to determine which texture is drawn in the middle of the background.
virtual bool ChooseBgStyle()
Whether or not the conditions have been met for this background style to draw its backgrounds....
int Slot
The ID of this surface background style.
virtual int ChooseFarTexture()
Allows you to determine which texture is drawn in the very back of the background....
virtual int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b)
Allows you to determine which texture is drawn in the closest part of the background....
string Name
The internal name of this surface background style.
virtual bool PreDrawCloseBackground(SpriteBatch spriteBatch)
Gives you complete freedom over how the closest part of the background is drawn. Return true for Choo...
Each background style determines in its own way how exactly the background is drawn....
int Slot
The ID of this underground background style.
string Name
The internal name of this underground background style.
virtual bool Autoload(ref string name)
Allows you to automatically add a ModUgBgStyle instead of using Mod.AddUgBgStyle. Return true to allo...
Mod mod
The mod that added this underground background style.
abstract void FillTextureArray(int[] textureSlots)
Allows you to determine which textures make up the background by assigning their background slots/IDs...
virtual bool ChooseBgStyle()
Whether or not the conditions have been met for this background style to draw its backgrounds....
bool Autoload
Whether or not this mod will autoload content by default. Autoloading content means you do not need t...