tModLoader v2024.05
A mod to make and play Terraria mods
CombatText Class Reference

Represents floating text in the game world most typically used for damage numbers and healing numbers.
For non-overlapping in-game text, such as reforge messages, use PopupText instead. Use the NewText(Rectangle, Color, int, bool, bool) or NewText(Rectangle, Color, string, bool, bool) methods to create a new instance.
In multiplayer, ID.MessageID.CombatTextInt and ID.MessageID.CombatTextString network messages can be used to sync a combat text if manually spawned.
More...

Public Member Functions

void Update ()
 

Static Public Member Functions

static void clearAll ()
 
static int NewText (Rectangle location, Color color, int amount, bool dramatic=false, bool dot=false)
 
static int NewText (Rectangle location, Color color, string text, bool dramatic=false, bool dot=false)
 
static void UpdateCombatText ()
 

Public Attributes

bool active
 
float alpha
 
int alphaDir = 1
 
Color color
 
bool crit
 
bool dot
 
int lifeTime
 
Vector2 position
 
float rotation
 
float scale = 1f
 
string text = ""
 
Vector2 velocity
 

Static Public Attributes

static readonly Color DamagedFriendly = new Color(255, 80, 90, 255)
 
static readonly Color DamagedFriendlyCrit = new Color(255, 100, 30, 255)
 
static readonly Color DamagedHostile = new Color(255, 160, 80, 255)
 
static readonly Color DamagedHostileCrit = new Color(255, 100, 30, 255)
 
static readonly Color HealLife = new Color(100, 255, 100, 255)
 
static readonly Color HealMana = new Color(100, 100, 255, 255)
 
static readonly Color LifeRegen = new Color(255, 60, 70, 255)
 
static readonly Color LifeRegenNegative = new Color(255, 140, 40, 255)
 
static readonly Color OthersDamagedHostile = DamagedHostile * 0.4f
 
static readonly Color OthersDamagedHostileCrit = DamagedHostileCrit * 0.4f
 

Properties

static float TargetScale [get]
 

Detailed Description

Represents floating text in the game world most typically used for damage numbers and healing numbers.
For non-overlapping in-game text, such as reforge messages, use PopupText instead. Use the NewText(Rectangle, Color, int, bool, bool) or NewText(Rectangle, Color, string, bool, bool) methods to create a new instance.
In multiplayer, ID.MessageID.CombatTextInt and ID.MessageID.CombatTextString network messages can be used to sync a combat text if manually spawned.