Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DrawSelf()

override void Terraria.GameContent.UI.Elements.UICharacter.DrawSelf ( SpriteBatch spriteBatch)
inlineprotectedvirtual

Reimplemented from Terraria.UI.UIElement.

Definition at line 99 of file UICharacter.cs.

100 {
101 CalculatedStyle dimensions = GetDimensions();
102 if (_drawsBackPanel)
103 {
104 spriteBatch.Draw(_texture.Value, dimensions.Position(), Color.White);
105 }
106 UpdateAnim();
107 DrawPets(spriteBatch);
108 Vector2 playerPosition = GetPlayerPosition(ref dimensions);
111 Main.PlayerRenderer.DrawPlayer(Main.Camera, _player, playerPosition + Main.screenPosition, 0f, Vector2.Zero, 0f, _characterScale);
113 }
void Draw(Texture2D texture, Vector2 position, Color color)
void DrawPets(SpriteBatch spriteBatch)
Vector2 GetPlayerPosition(ref CalculatedStyle dimensions)
Item[] inventory
Definition Player.cs:1257
CalculatedStyle GetDimensions()
Definition UIElement.cs:382

References Terraria.GameContent.UI.Elements.UICharacter._blankItem, Terraria.GameContent.UI.Elements.UICharacter._characterScale, Terraria.GameContent.UI.Elements.UICharacter._drawsBackPanel, Terraria.GameContent.UI.Elements.UICharacter._player, Terraria.GameContent.UI.Elements.UICharacter._texture, Terraria.Main.Camera, Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), Terraria.GameContent.UI.Elements.UICharacter.DrawPets(), Terraria.UI.UIElement.GetDimensions(), Terraria.GameContent.UI.Elements.UICharacter.GetPlayerPosition(), Terraria.Player.inventory, Terraria.Main.PlayerRenderer, Terraria.UI.CalculatedStyle.Position(), Terraria.Main.screenPosition, Terraria.Player.selectedItem, Terraria.GameContent.UI.Elements.UICharacter.UpdateAnim(), ReLogic.Content.Asset< T >.Value, Microsoft.Xna.Framework.Color.White, and Microsoft.Xna.Framework.Vector2.Zero.