tModLoader v0.11.8.9
A mod to make and play Terraria mods
|
Each background style determines in its own way how exactly the background is drawn. This class serves as a collection of functions for above-ground backgrounds. More...
Public Member Functions | |
virtual bool | Autoload (ref string name) |
Allows you to automatically add a ModSurfaceBgStyle instead of using Mod.AddSurfaceBgStyle. 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 ModSurfaceBgStyle. 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... | |
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. This also lets you modify the scale and parallax (as well as two unfortunately-unknown parameters). More... | |
virtual int | ChooseFarTexture () |
Allows you to determine which texture is drawn in the very back of the background. Mod.GetBackgroundSlot may be useful here, as well as for the other texture-choosing hooks. More... | |
virtual int | ChooseMiddleTexture () |
Allows you to determine which texture is drawn in the middle of the background. More... | |
abstract void | ModifyFarFades (float[] fades, float transitionSpeed) |
Allows you to modify the transparency of all background styles that exist. In general, you should move the index equal to this style's slot closer to 1, and all other indexes closer to 0. The transitionSpeed parameter is what you should add/subtract to each element of the fades parameter. See the ExampleMod for an example. More... | |
virtual bool | PreDrawCloseBackground (SpriteBatch spriteBatch) |
Gives you complete freedom over how the closest part of the background is drawn. Return true for ChooseCloseTexture to have an effect; return false to disable tModLoader's own code for drawing the close background. More... | |
Properties | |
Mod | mod [get, set] |
The mod that added this surface background style. More... | |
string | Name [get, set] |
The internal name of this surface background style. More... | |
int | Slot [get, set] |
The ID of this surface background style. More... | |
Each background style determines in its own way how exactly the background is drawn. This class serves as a collection of functions for above-ground backgrounds.
Definition at line 57 of file ModBackgroundStyle.cs.
|
virtual |
Allows you to automatically add a ModSurfaceBgStyle instead of using Mod.AddSurfaceBgStyle. 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 ModSurfaceBgStyle.
Definition at line 86 of file ModBackgroundStyle.cs.
References Terraria.ModLoader.ModProperties.Autoload, Terraria.ModLoader.ModSurfaceBgStyle.mod, and Terraria.ModLoader.Mod.Properties.
Referenced by Terraria.ModLoader.Mod.AutoloadSurfaceBgStyle().
|
virtual |
Whether or not the conditions have been met for this background style to draw its backgrounds. Returns false by default.
Definition at line 93 of file ModBackgroundStyle.cs.
|
virtual |
Allows you to determine which texture is drawn in the closest part of the background. This also lets you modify the scale and parallax (as well as two unfortunately-unknown parameters).
scale | The scale. |
parallax | The parallax value. |
a | a? |
b | b? |
Definition at line 131 of file ModBackgroundStyle.cs.
|
virtual |
Allows you to determine which texture is drawn in the very back of the background. Mod.GetBackgroundSlot may be useful here, as well as for the other texture-choosing hooks.
Definition at line 105 of file ModBackgroundStyle.cs.
|
virtual |
Allows you to determine which texture is drawn in the middle of the background.
Definition at line 112 of file ModBackgroundStyle.cs.
|
pure virtual |
Allows you to modify the transparency of all background styles that exist. In general, you should move the index equal to this style's slot closer to 1, and all other indexes closer to 0. The transitionSpeed parameter is what you should add/subtract to each element of the fades parameter. See the ExampleMod for an example.
|
virtual |
Gives you complete freedom over how the closest part of the background is drawn. Return true for ChooseCloseTexture to have an effect; return false to disable tModLoader's own code for drawing the close background.
Definition at line 119 of file ModBackgroundStyle.cs.
|
getset |
The mod that added this surface background style.
Definition at line 62 of file ModBackgroundStyle.cs.
Referenced by Terraria.ModLoader.ModSurfaceBgStyle.Autoload().
|
getset |
The internal name of this surface background style.
Definition at line 70 of file ModBackgroundStyle.cs.
Referenced by Terraria.ModLoader.Mod.AutoloadSurfaceBgStyle().
|
getset |
The ID of this surface background style.
Definition at line 78 of file ModBackgroundStyle.cs.