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

This class serves as a way to store information about a line that will be drawn of tooltip for an item. You will create and manipulate objects of this class if you use the draw hooks for tooltips in ModItem and GlobalItem. For examples, see ExampleSword More...

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

Public Member Functions

 DrawableTooltipLine (TooltipLine parent, int index, int x, int y, Color color)
 Creates a new DrawableTooltipLine object More...
 
- Public Member Functions inherited from Terraria.ModLoader.TooltipLine
 TooltipLine (Mod mod, string name, string text)
 Creates a tooltip line object with the given mod, identifier name, and text. More...
 

Public Attributes

Vector2 baseScale = Vector2.One
 The baseScale of this tooltip. When drawing the One Drop logo the scale is calculated by (baseScale.X + baseScale.Y) / 2 More...
 
DynamicSpriteFont font = Main.fontMouseText
 The font this tooltip would be drawn with More...
 
readonly int index
 The index of the tooltip in the array More...
 
new readonly bool isModifier
 Whether or not this tooltip gives prefix information. This will make it so that the tooltip is colored either green or red. More...
 
new readonly bool isModifierBad
 If isModifier is true, this determines whether the tooltip is colored green or red. More...
 
float maxWidth = -1
 
new readonly bool oneDropLogo
 Whether the tooltip is a One Drop logo or not. If it is, the tooltip text will be empty. More...
 
Vector2 origin = Vector2.Zero
 The origin of this tooltip More...
 
float rotation = 0f
 The rotation this tooltip would be drawn in More...
 
float spread = 2
 
new readonly string text
 The text of this tooltip. More...
 
int X
 The X position where the tooltip would be drawn. More...
 
int Y
 The Y position where the tooltip would be drawn. More...
 
- Public Attributes inherited from Terraria.ModLoader.TooltipLine
bool isModifier = false
 Whether or not this tooltip gives prefix information. This will make it so that the tooltip is colored either green or red. More...
 
bool isModifierBad = false
 If isModifier is true, this determines whether the tooltip is colored green or red. More...
 
readonly string mod
 The name of the mod adding this tooltip line. This will be "Terraria" for all vanilla tooltip lines. More...
 
readonly string Name
 The name of the tooltip, used to help you identify its function. More...
 
Color? overrideColor = null
 This completely overrides the color the tooltip is drawn in. If it is set to null (the default value) then the tooltip's color will not be overridden. More...
 
string text
 The actual text that this tooltip displays. More...
 

Properties

Color color [get, set]
 The color the tooltip would be drawn in More...
 
int OriginalX [get, set]
 The X position where the tooltip would be drawn that is not adjusted by mods. More...
 
int OriginalY [get, set]
 The Y position where the tooltip would be drawn that is not adjusted by mods. More...
 
new? Color overrideColor [get, set]
 If the tooltip line's color was overridden this will hold that color, it will be null otherwise More...
 

Private Attributes

int _originalX
 
int _originalY
 

Detailed Description

This class serves as a way to store information about a line that will be drawn of tooltip for an item. You will create and manipulate objects of this class if you use the draw hooks for tooltips in ModItem and GlobalItem. For examples, see ExampleSword

Definition at line 13 of file DrawableTooltipLine.cs.

Constructor & Destructor Documentation

◆ DrawableTooltipLine()

Terraria.ModLoader.DrawableTooltipLine.DrawableTooltipLine ( TooltipLine  parent,
int  index,
int  x,
int  y,
Color  color 
)

Creates a new DrawableTooltipLine object

Parameters
parentThe TooltipLine to make this DrawableTooltipLine from
indexThe index of the line in the array
xThe X position where the tooltip would be drawn.
yThe Y position where the tooltip would be drawn.
colorThe color the tooltip would be drawn in

Definition at line 97 of file DrawableTooltipLine.cs.

97 : base(parent.mod, parent.Name, parent.text) {
98 isModifier = parent.isModifier;
99 isModifierBad = parent.isModifierBad;
100 overrideColor = parent.overrideColor;
101 oneDropLogo = parent.oneDropLogo;
102 text = parent.text;
103
104 this.index = index;
105 OriginalX = x;
106 OriginalY = y;
107 this.color = color;
108 }
int OriginalX
The X position where the tooltip would be drawn that is not adjusted by mods.
Color color
The color the tooltip would be drawn in
new readonly bool isModifier
Whether or not this tooltip gives prefix information. This will make it so that the tooltip is colore...
new readonly string text
The text of this tooltip.
new readonly bool isModifierBad
If isModifier is true, this determines whether the tooltip is colored green or red.
readonly int index
The index of the tooltip in the array
int OriginalY
The Y position where the tooltip would be drawn that is not adjusted by mods.
new readonly bool oneDropLogo
Whether the tooltip is a One Drop logo or not. If it is, the tooltip text will be empty.
new? Color overrideColor
If the tooltip line's color was overridden this will hold that color, it will be null otherwise

References Terraria.ModLoader.DrawableTooltipLine.color, Terraria.ModLoader.DrawableTooltipLine.index, Terraria.ModLoader.DrawableTooltipLine.isModifier, Terraria.ModLoader.TooltipLine.isModifier, Terraria.ModLoader.DrawableTooltipLine.isModifierBad, Terraria.ModLoader.TooltipLine.isModifierBad, Terraria.ModLoader.DrawableTooltipLine.oneDropLogo, Terraria.ModLoader.DrawableTooltipLine.OriginalX, Terraria.ModLoader.DrawableTooltipLine.OriginalY, Terraria.ModLoader.DrawableTooltipLine.overrideColor, Terraria.ModLoader.TooltipLine.overrideColor, Terraria.ModLoader.DrawableTooltipLine.text, and Terraria.ModLoader.TooltipLine.text.

Member Data Documentation

◆ _originalX

int Terraria.ModLoader.DrawableTooltipLine._originalX
private

Definition at line 32 of file DrawableTooltipLine.cs.

◆ _originalY

int Terraria.ModLoader.DrawableTooltipLine._originalY
private

Definition at line 41 of file DrawableTooltipLine.cs.

◆ baseScale

Vector2 Terraria.ModLoader.DrawableTooltipLine.baseScale = Vector2.One

The baseScale of this tooltip. When drawing the One Drop logo the scale is calculated by (baseScale.X + baseScale.Y) / 2

Definition at line 84 of file DrawableTooltipLine.cs.

◆ font

DynamicSpriteFont Terraria.ModLoader.DrawableTooltipLine.font = Main.fontMouseText

The font this tooltip would be drawn with

Definition at line 72 of file DrawableTooltipLine.cs.

◆ index

readonly int Terraria.ModLoader.DrawableTooltipLine.index

The index of the tooltip in the array

Definition at line 22 of file DrawableTooltipLine.cs.

Referenced by Terraria.ModLoader.DrawableTooltipLine.DrawableTooltipLine().

◆ isModifier

new readonly bool Terraria.ModLoader.DrawableTooltipLine.isModifier

Whether or not this tooltip gives prefix information. This will make it so that the tooltip is colored either green or red.

Definition at line 26 of file DrawableTooltipLine.cs.

Referenced by Terraria.ModLoader.DrawableTooltipLine.DrawableTooltipLine().

◆ isModifierBad

new readonly bool Terraria.ModLoader.DrawableTooltipLine.isModifierBad

If isModifier is true, this determines whether the tooltip is colored green or red.

Definition at line 30 of file DrawableTooltipLine.cs.

Referenced by Terraria.ModLoader.DrawableTooltipLine.DrawableTooltipLine().

◆ maxWidth

float Terraria.ModLoader.DrawableTooltipLine.maxWidth = -1

Definition at line 86 of file DrawableTooltipLine.cs.

◆ oneDropLogo

new readonly bool Terraria.ModLoader.DrawableTooltipLine.oneDropLogo

Whether the tooltip is a One Drop logo or not. If it is, the tooltip text will be empty.

Definition at line 68 of file DrawableTooltipLine.cs.

Referenced by Terraria.ModLoader.DrawableTooltipLine.DrawableTooltipLine().

◆ origin

Vector2 Terraria.ModLoader.DrawableTooltipLine.origin = Vector2.Zero

The origin of this tooltip

Definition at line 80 of file DrawableTooltipLine.cs.

◆ rotation

float Terraria.ModLoader.DrawableTooltipLine.rotation = 0f

The rotation this tooltip would be drawn in

Definition at line 76 of file DrawableTooltipLine.cs.

◆ spread

float Terraria.ModLoader.DrawableTooltipLine.spread = 2

Definition at line 87 of file DrawableTooltipLine.cs.

◆ text

new readonly string Terraria.ModLoader.DrawableTooltipLine.text

The text of this tooltip.

Definition at line 18 of file DrawableTooltipLine.cs.

Referenced by Terraria.ModLoader.DrawableTooltipLine.DrawableTooltipLine().

◆ X

int Terraria.ModLoader.DrawableTooltipLine.X

The X position where the tooltip would be drawn.

Definition at line 52 of file DrawableTooltipLine.cs.

◆ Y

int Terraria.ModLoader.DrawableTooltipLine.Y

The Y position where the tooltip would be drawn.

Definition at line 56 of file DrawableTooltipLine.cs.

Property Documentation

◆ color

Color Terraria.ModLoader.DrawableTooltipLine.color
getset

The color the tooltip would be drawn in

Definition at line 60 of file DrawableTooltipLine.cs.

60{ get; internal set; }

Referenced by Terraria.ModLoader.DrawableTooltipLine.DrawableTooltipLine().

◆ OriginalX

int Terraria.ModLoader.DrawableTooltipLine.OriginalX
getset

The X position where the tooltip would be drawn that is not adjusted by mods.

Definition at line 36 of file DrawableTooltipLine.cs.

36 {
37 get { return _originalX; }
38 internal set { X = _originalX = value; }
39 }
int X
The X position where the tooltip would be drawn.

Referenced by Terraria.ModLoader.DrawableTooltipLine.DrawableTooltipLine().

◆ OriginalY

int Terraria.ModLoader.DrawableTooltipLine.OriginalY
getset

The Y position where the tooltip would be drawn that is not adjusted by mods.

Definition at line 45 of file DrawableTooltipLine.cs.

45 {
46 get { return _originalY; }
47 internal set { Y = _originalY = value; }
48 }
int Y
The Y position where the tooltip would be drawn.

Referenced by Terraria.ModLoader.DrawableTooltipLine.DrawableTooltipLine().

◆ overrideColor

new? Color Terraria.ModLoader.DrawableTooltipLine.overrideColor
getset

If the tooltip line's color was overridden this will hold that color, it will be null otherwise

Definition at line 64 of file DrawableTooltipLine.cs.

64{ get; internal set; }

Referenced by Terraria.ModLoader.DrawableTooltipLine.DrawableTooltipLine().