tModLoader v0.11.8.9
A mod to make and play Terraria mods
Terraria.ModLoader.PlayerLayer Class Reference

This class represents a DrawLayer for the player, and uses PlayerDrawInfo as its InfoType. Drawing should be done by adding Terraria.DataStructures.DrawData objects to Main.playerDrawData. More...

+ Inheritance diagram for Terraria.ModLoader.PlayerLayer:
+ Collaboration diagram for Terraria.ModLoader.PlayerLayer:

Public Member Functions

 PlayerLayer (string mod, string name, Action< PlayerDrawInfo > layer)
 Creates a PlayerLayer with the given mod name, identifier name, and drawing action. More...
 
 PlayerLayer (string mod, string name, PlayerLayer parent, Action< PlayerDrawInfo > layer)
 Creates a PlayerLayer with the given mod name, identifier name, parent layer, and drawing action. More...
 
- Public Member Functions inherited from Terraria.ModLoader.DrawLayer< PlayerDrawInfo >
virtual void Draw (ref InfoType drawInfo)
 Invokes this DrawLayer's layer action. More...
 
bool ShouldDraw< T > (IList< T > layers)
 Whether or not this layer should be drawn. Returns false if visible is false. If layerList is of type List<DrawLayer<InfoType>> and parent is not null, this will also return false if the parent is not drawn. More...
 

Static Public Attributes

static readonly PlayerLayer Arms = CreateVanillaLayer("Arms")
 Draws the player's arms (including the armor's arms if applicable). More...
 
static readonly PlayerLayer BackAcc = CreateVanillaLayer("BackAcc")
 Draws the player's back accessory and held item's backpack. More...
 
static readonly PlayerLayer BalloonAcc = CreateVanillaLayer("BalloonAcc")
 Draws the player's balloon accessory. More...
 
static readonly PlayerLayer Body = CreateVanillaLayer("Body")
 Draws the player's body armor or shirts. More...
 
static readonly PlayerLayer Face = CreateVanillaLayer("Face")
 Draws the player's face and eyes. More...
 
static readonly PlayerLayer FaceAcc = CreateVanillaLayer("FaceAcc")
 Draws the player's face accessory. More...
 
static readonly PlayerLayer FrontAcc = CreateVanillaLayer("FrontAcc")
 Draws the player's front accessory. More...
 
static readonly PlayerLayer Hair = CreateVanillaLayer("Hair")
 Draws the player's hair. More...
 
static readonly PlayerLayer HairBack = CreateVanillaLayer("HairBack")
 Draws the player's hair. To be honest this layer seems kind of useless. More...
 
static readonly PlayerLayer HandOffAcc = CreateVanillaLayer("HandOffAcc")
 Draws the player's hand off accessory. More...
 
static readonly PlayerLayer HandOnAcc = CreateVanillaLayer("HandOnAcc")
 Draws the player's hand on accessory. Also draws the player's held item if the player is in the middle of using a claw item. More...
 
static readonly PlayerLayer Head = CreateVanillaLayer("Head")
 Draws the player's head armor. More...
 
static readonly PlayerLayer HeldItem = CreateVanillaLayer("HeldItem")
 Draws the player's held item. More...
 
static readonly PlayerLayer HeldProjBack = CreateVanillaLayer("HeldProjBack")
 Draws the player's held projectile if it should be drawn behind the held item and arms. More...
 
static readonly PlayerLayer HeldProjFront = CreateVanillaLayer("HeldProjFront")
 Draws the player's held projectile if it should be drawn in front of the held item and arms. More...
 
static readonly PlayerLayer Legs = CreateVanillaLayer("Legs")
 Draws the player's leg armor or pants and shoes. More...
 
static readonly PlayerLayer MiscEffectsBack = CreateVanillaLayer("MiscEffectsBack")
 Draws miscellaneous effects behind the player. More...
 
static readonly PlayerLayer MiscEffectsFront = CreateVanillaLayer("MiscEffectsFront")
 Draws miscellaneous effects in front of the player. More...
 
static readonly PlayerLayer MountBack = CreateVanillaLayer("MountBack")
 Draws the back textures of the player's mount. Also draws the player's magic carpet. More...
 
static readonly PlayerLayer MountFront = CreateVanillaLayer("MountFront")
 Draws the front textures of the player's mount. Also draws the pulley if the player is hanging on a rope. More...
 
static readonly PlayerLayer NeckAcc = CreateVanillaLayer("NeckAcc")
 Draws the player's neck accessory. More...
 
static readonly PlayerLayer ShieldAcc = CreateVanillaLayer("ShieldAcc")
 Draws the player's shield accessory. More...
 
static readonly PlayerLayer ShoeAcc = CreateVanillaLayer("ShoeAcc")
 Draws the player's shoe accessory. More...
 
static readonly PlayerLayer Skin = CreateVanillaLayer("Skin")
 Draws the player's body and leg skin. More...
 
static readonly PlayerLayer SolarShield = CreateVanillaLayer("SolarShield")
 Draws the player's solar shield if the player has one. More...
 
static readonly PlayerLayer WaistAcc = CreateVanillaLayer("WaistAcc")
 Draws the player's waist accessory. More...
 
static readonly PlayerLayer Wings = CreateVanillaLayer("Wings")
 Draws the layer's wings. More...
 

Static Private Member Functions

static PlayerLayer CreateVanillaLayer (string name)
 

Additional Inherited Members

- Public Attributes inherited from Terraria.ModLoader.DrawLayer< PlayerDrawInfo >
readonly Action< InfoType > layer
 The delegate of this method, which can either do the actual drawing or add draw data, depending on what kind of layer this is. More...
 
readonly string mod
 The name of the mod to which this DrawLayer belongs. More...
 
readonly string Name
 The name which identifies this DrawLayer. More...
 
readonly DrawLayer< InfoType > parent
 The parent of this DrawLayer. If the parent is not drawn, this layer will not be drawn either. Defaults to null, which skips the parent check. More...
 
bool visible
 Whether or not this DrawLayer should be drawn. For vanilla layers, this will be set to true before all drawing-related hooks are called. For modded layers, you must set this to true or false yourself. More...
 
- Protected Member Functions inherited from Terraria.ModLoader.DrawLayer< PlayerDrawInfo >
 DrawLayer (string mod, string name, Action< InfoType > layer)
 Creates a DrawLayer with the given mod name, identifier name, and drawing action. More...
 
 DrawLayer (string mod, string name, DrawLayer< InfoType > parent, Action< InfoType > layer)
 Creates a DrawLayer with the given mod name, identifier name, parent layer, and drawing action. More...
 

Detailed Description

This class represents a DrawLayer for the player, and uses PlayerDrawInfo as its InfoType. Drawing should be done by adding Terraria.DataStructures.DrawData objects to Main.playerDrawData.

Definition at line 92 of file DrawLayer.cs.

Constructor & Destructor Documentation

◆ PlayerLayer() [1/2]

Terraria.ModLoader.PlayerLayer.PlayerLayer ( string  mod,
string  name,
Action< PlayerDrawInfo layer 
)

Creates a PlayerLayer with the given mod name, identifier name, and drawing action.

Parameters
mod
name
layer

Definition at line 209 of file DrawLayer.cs.

210 : base(mod, name, layer) {
211 }
readonly string mod
The name of the mod to which this DrawLayer belongs.
Definition: DrawLayer.cs:15
readonly Action< InfoType > layer
The delegate of this method, which can either do the actual drawing or add draw data,...
Definition: DrawLayer.cs:27

Referenced by Terraria.ModLoader.PlayerLayer.CreateVanillaLayer().

+ Here is the caller graph for this function:

◆ PlayerLayer() [2/2]

Terraria.ModLoader.PlayerLayer.PlayerLayer ( string  mod,
string  name,
PlayerLayer  parent,
Action< PlayerDrawInfo layer 
)

Creates a PlayerLayer with the given mod name, identifier name, parent layer, and drawing action.

Parameters
mod
name
parent
layer

Definition at line 220 of file DrawLayer.cs.

221 : base(mod, name, parent, layer) {
222 }
readonly DrawLayer< InfoType > parent
The parent of this DrawLayer. If the parent is not drawn, this layer will not be drawn either....
Definition: DrawLayer.cs:23

Member Function Documentation

◆ CreateVanillaLayer()

static PlayerLayer Terraria.ModLoader.PlayerLayer.CreateVanillaLayer ( string  name)
staticprivate

Definition at line 224 of file DrawLayer.cs.

224 {
225 return new PlayerLayer("Terraria", name, _ => { });
226 }
PlayerLayer(string mod, string name, Action< PlayerDrawInfo > layer)
Creates a PlayerLayer with the given mod name, identifier name, and drawing action.
Definition: DrawLayer.cs:209

References Terraria.ModLoader.PlayerLayer.PlayerLayer().

+ Here is the call graph for this function:

Member Data Documentation

◆ Arms

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.Arms = CreateVanillaLayer("Arms")
static

Draws the player's arms (including the armor's arms if applicable).

Definition at line 185 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ BackAcc

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.BackAcc = CreateVanillaLayer("BackAcc")
static

Draws the player's back accessory and held item's backpack.

Definition at line 109 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ BalloonAcc

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.BalloonAcc = CreateVanillaLayer("BalloonAcc")
static

Draws the player's balloon accessory.

Definition at line 117 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ Body

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.Body = CreateVanillaLayer("Body")
static

Draws the player's body armor or shirts.

Definition at line 133 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ Face

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.Face = CreateVanillaLayer("Face")
static

Draws the player's face and eyes.

Definition at line 149 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ FaceAcc

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.FaceAcc = CreateVanillaLayer("FaceAcc")
static

Draws the player's face accessory.

Definition at line 161 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ FrontAcc

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.FrontAcc = CreateVanillaLayer("FrontAcc")
static

Draws the player's front accessory.

Definition at line 197 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ Hair

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.Hair = CreateVanillaLayer("Hair")
static

Draws the player's hair.

Definition at line 153 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ HairBack

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.HairBack = CreateVanillaLayer("HairBack")
static

Draws the player's hair. To be honest this layer seems kind of useless.

Definition at line 97 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ HandOffAcc

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.HandOffAcc = CreateVanillaLayer("HandOffAcc")
static

Draws the player's hand off accessory.

Definition at line 137 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ HandOnAcc

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.HandOnAcc = CreateVanillaLayer("HandOnAcc")
static

Draws the player's hand on accessory. Also draws the player's held item if the player is in the middle of using a claw item.

Definition at line 189 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ Head

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.Head = CreateVanillaLayer("Head")
static

Draws the player's head armor.

Definition at line 157 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ HeldItem

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.HeldItem = CreateVanillaLayer("HeldItem")
static

Draws the player's held item.

Definition at line 181 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ HeldProjBack

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.HeldProjBack = CreateVanillaLayer("HeldProjBack")
static

Draws the player's held projectile if it should be drawn behind the held item and arms.

Definition at line 177 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ HeldProjFront

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.HeldProjFront = CreateVanillaLayer("HeldProjFront")
static

Draws the player's held projectile if it should be drawn in front of the held item and arms.

Definition at line 193 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ Legs

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.Legs = CreateVanillaLayer("Legs")
static

Draws the player's leg armor or pants and shoes.

Definition at line 125 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ MiscEffectsBack

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.MiscEffectsBack = CreateVanillaLayer("MiscEffectsBack")
static

Draws miscellaneous effects behind the player.

Definition at line 105 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ MiscEffectsFront

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.MiscEffectsFront = CreateVanillaLayer("MiscEffectsFront")
static

Draws miscellaneous effects in front of the player.

Definition at line 201 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ MountBack

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.MountBack = CreateVanillaLayer("MountBack")
static

Draws the back textures of the player's mount. Also draws the player's magic carpet.

Definition at line 101 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ MountFront

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.MountFront = CreateVanillaLayer("MountFront")
static

Draws the front textures of the player's mount. Also draws the pulley if the player is hanging on a rope.

Definition at line 165 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ NeckAcc

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.NeckAcc = CreateVanillaLayer("NeckAcc")
static

Draws the player's neck accessory.

Definition at line 145 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ ShieldAcc

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.ShieldAcc = CreateVanillaLayer("ShieldAcc")
static

Draws the player's shield accessory.

Definition at line 169 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ ShoeAcc

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.ShoeAcc = CreateVanillaLayer("ShoeAcc")
static

Draws the player's shoe accessory.

Definition at line 129 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ Skin

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.Skin = CreateVanillaLayer("Skin")
static

Draws the player's body and leg skin.

Definition at line 121 of file DrawLayer.cs.

◆ SolarShield

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.SolarShield = CreateVanillaLayer("SolarShield")
static

Draws the player's solar shield if the player has one.

Definition at line 173 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ WaistAcc

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.WaistAcc = CreateVanillaLayer("WaistAcc")
static

Draws the player's waist accessory.

Definition at line 141 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().

◆ Wings

readonly PlayerLayer Terraria.ModLoader.PlayerLayer.Wings = CreateVanillaLayer("Wings")
static

Draws the layer's wings.

Definition at line 113 of file DrawLayer.cs.

Referenced by Terraria.ModLoader.PlayerHooks.GetDrawLayers().