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

This class represents a DrawLayer for the player's map icon, and uses PlayerDrawHeadInfo as its InfoType. Drawing should be done directly through drawInfo.spriteBatch. More...

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

Public Member Functions

 PlayerHeadLayer (string mod, string name, Action< PlayerHeadDrawInfo > layer)
 Creates a PlayerHeadLayer with the given mod name, identifier name, and drawing action. More...
 
 PlayerHeadLayer (string mod, string name, PlayerHeadLayer parent, Action< PlayerHeadDrawInfo > layer)
 Creates a PlayerHeadLayer with the given mod name, identifier name, parent layer, and drawing action. More...
 
- Public Member Functions inherited from Terraria.ModLoader.DrawLayer< PlayerHeadDrawInfo >
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 PlayerHeadLayer AltHair = CreateVanillaLayer("AltHair")
 Draws the player's alternate (hat) hair. More...
 
static readonly PlayerHeadLayer Armor = CreateVanillaLayer("Armor")
 Draws the player's head armor. More...
 
static readonly PlayerHeadLayer FaceAcc = CreateVanillaLayer("FaceAcc")
 Draws the player's face accessory. More...
 
static readonly PlayerHeadLayer Hair = CreateVanillaLayer("Hair")
 Draws the player's hair. More...
 
static readonly PlayerHeadLayer Head = CreateVanillaLayer("Head")
 Draws the player's face and eyes. More...
 

Static Private Member Functions

static PlayerHeadLayer CreateVanillaLayer (string name)
 

Additional Inherited Members

- Public Attributes inherited from Terraria.ModLoader.DrawLayer< PlayerHeadDrawInfo >
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< PlayerHeadDrawInfo >
 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's map icon, and uses PlayerDrawHeadInfo as its InfoType. Drawing should be done directly through drawInfo.spriteBatch.

Definition at line 232 of file DrawLayer.cs.

Constructor & Destructor Documentation

◆ PlayerHeadLayer() [1/2]

Terraria.ModLoader.PlayerHeadLayer.PlayerHeadLayer ( string  mod,
string  name,
Action< PlayerHeadDrawInfo layer 
)

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

Parameters
mod
name
layer

Definition at line 261 of file DrawLayer.cs.

262 : base(mod, name, layer) {
263 }
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.PlayerHeadLayer.CreateVanillaLayer().

+ Here is the caller graph for this function:

◆ PlayerHeadLayer() [2/2]

Terraria.ModLoader.PlayerHeadLayer.PlayerHeadLayer ( string  mod,
string  name,
PlayerHeadLayer  parent,
Action< PlayerHeadDrawInfo layer 
)

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

Parameters
mod
name
parent
layer

Definition at line 272 of file DrawLayer.cs.

273 : base(mod, name, parent, layer) {
274 }
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 PlayerHeadLayer Terraria.ModLoader.PlayerHeadLayer.CreateVanillaLayer ( string  name)
staticprivate

Definition at line 276 of file DrawLayer.cs.

276 {
277 return new PlayerHeadLayer("Terraria", name, _ => { });
278 }
PlayerHeadLayer(string mod, string name, Action< PlayerHeadDrawInfo > layer)
Creates a PlayerHeadLayer with the given mod name, identifier name, and drawing action.
Definition: DrawLayer.cs:261

References Terraria.ModLoader.PlayerHeadLayer.PlayerHeadLayer().

+ Here is the call graph for this function:

Member Data Documentation

◆ AltHair

readonly PlayerHeadLayer Terraria.ModLoader.PlayerHeadLayer.AltHair = CreateVanillaLayer("AltHair")
static

Draws the player's alternate (hat) hair.

Definition at line 245 of file DrawLayer.cs.

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

◆ Armor

readonly PlayerHeadLayer Terraria.ModLoader.PlayerHeadLayer.Armor = CreateVanillaLayer("Armor")
static

Draws the player's head armor.

Definition at line 249 of file DrawLayer.cs.

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

◆ FaceAcc

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

Draws the player's face accessory.

Definition at line 253 of file DrawLayer.cs.

◆ Hair

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

Draws the player's hair.

Definition at line 241 of file DrawLayer.cs.

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

◆ Head

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

Draws the player's face and eyes.

Definition at line 237 of file DrawLayer.cs.

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