tModLoader v0.11.8.9
A mod to make and play Terraria mods
|
This class represents a type of dust that is added by a mod. Only one instance of this class will ever exist for each type of dust you add. More...
Public Member Functions | |
virtual bool | Autoload (ref string name, ref string texture) |
Allows you to automatically add a type of dust without having to use Mod.AddDust. By default returns the mod's Autoload property. Return true to automatically add the dust. Name will be initialized to the dust's class name, and Texture will be initialized to the dust's namespace and overriding class name with periods replaced with slashes. The name parameter determines the internal name and the texture parameter determines the texture path. More... | |
virtual ? Color | GetAlpha (Dust dust, Color lightColor) |
Allows you to override the color this dust will draw in. Return null to draw it in the normal light color; returns null by default. Note that the dust.noLight field makes the dust ignore lighting and draw in full brightness, and can be set in OnSpawn instead of having to return Color.White here. More... | |
virtual bool | MidUpdate (Dust dust) |
Allows you to add behavior to this dust on top of the default dust behavior. Return true if you're applying your own behavior; return false to make the dust slow down by itself. Normally you will want this to return true. More... | |
virtual void | OnSpawn (Dust dust) |
Allows you to modify a dust's fields when it is created. More... | |
virtual void | SetDefaults () |
Allows you to set this ModDust's updateType field and modify the Terraria.GameContent.ChildSafety.SafeDust array. More... | |
virtual bool | Update (Dust dust) |
Allows you to customize how you want this type of dust to behave. Return true to allow for vanilla dust updating to also take place; will return true by default. Normally you will want this to return false. More... | |
Static Public Member Functions | |
static ModDust | GetDust (int type) |
Gets the ModDust instance with the given type. Returns null if no ModDust with the given type exists. More... | |
Public Attributes | |
int | updateType = -1 |
Allows you to choose a type of dust for this type of dust to copy the behavior of. Defaults to -1, which means that no behavior is copied. More... | |
Properties | |
Mod | mod [get, set] |
The mod that added this type of dust. More... | |
string | Name [get, set] |
The internal name of this type of dust. More... | |
Texture2D | Texture [get, set] |
The sprite sheet that this type of dust uses. Normally a sprite sheet will consist of a vertical alignment of three 10 x 10 pixel squares, each one containing a possible look for the dust. More... | |
int | Type [get, set] |
The ID of this type of dust. More... | |
Static Private Attributes | |
static int | nextDust = DustID.Count |
This class represents a type of dust that is added by a mod. Only one instance of this class will ever exist for each type of dust you add.
Definition at line 13 of file ModDust.cs.
|
virtual |
Allows you to automatically add a type of dust without having to use Mod.AddDust. By default returns the mod's Autoload property. Return true to automatically add the dust. Name will be initialized to the dust's class name, and Texture will be initialized to the dust's namespace and overriding class name with periods replaced with slashes. The name parameter determines the internal name and the texture parameter determines the texture path.
Definition at line 118 of file ModDust.cs.
References Terraria.ModLoader.ModProperties.Autoload, Terraria.ModLoader.ModDust.mod, and Terraria.ModLoader.Mod.Properties.
Referenced by Terraria.ModLoader.Mod.AutoloadDust().
|
virtual |
Allows you to override the color this dust will draw in. Return null to draw it in the normal light color; returns null by default. Note that the dust.noLight field makes the dust ignore lighting and draw in full brightness, and can be set in OnSpawn instead of having to return Color.White here.
Definition at line 164 of file ModDust.cs.
|
static |
Gets the ModDust instance with the given type. Returns null if no ModDust with the given type exists.
Definition at line 57 of file ModDust.cs.
|
virtual |
Allows you to add behavior to this dust on top of the default dust behavior. Return true if you're applying your own behavior; return false to make the dust slow down by itself. Normally you will want this to return true.
Definition at line 147 of file ModDust.cs.
|
virtual |
Allows you to modify a dust's fields when it is created.
Definition at line 131 of file ModDust.cs.
|
virtual |
Allows you to set this ModDust's updateType field and modify the Terraria.GameContent.ChildSafety.SafeDust array.
Definition at line 125 of file ModDust.cs.
|
virtual |
Allows you to customize how you want this type of dust to behave. Return true to allow for vanilla dust updating to also take place; will return true by default. Normally you will want this to return false.
Definition at line 140 of file ModDust.cs.
|
staticprivate |
Definition at line 15 of file ModDust.cs.
int Terraria.ModLoader.ModDust.updateType = -1 |
Allows you to choose a type of dust for this type of dust to copy the behavior of. Defaults to -1, which means that no behavior is copied.
Definition at line 18 of file ModDust.cs.
|
getset |
The mod that added this type of dust.
Definition at line 39 of file ModDust.cs.
Referenced by Terraria.ModLoader.ModDust.Autoload().
|
getset |
The internal name of this type of dust.
Definition at line 23 of file ModDust.cs.
Referenced by Terraria.ModLoader.Mod.AutoloadDust().
|
getset |
The sprite sheet that this type of dust uses. Normally a sprite sheet will consist of a vertical alignment of three 10 x 10 pixel squares, each one containing a possible look for the dust.
Definition at line 31 of file ModDust.cs.
|
getset |
The ID of this type of dust.
Definition at line 47 of file ModDust.cs.