tModLoader  0.12 Alpha
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...

Inherits Terraria.ModLoader.TooltipLine.

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 = FontAssets.MouseText.Value
 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...
 

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

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

Member Data Documentation

◆ 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

◆ font

DynamicSpriteFont Terraria.ModLoader.DrawableTooltipLine.font = FontAssets.MouseText.Value

The font this tooltip would be drawn with

◆ index

readonly int Terraria.ModLoader.DrawableTooltipLine.index

The index of the tooltip in the array

◆ 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.

◆ isModifierBad

new readonly bool Terraria.ModLoader.DrawableTooltipLine.isModifierBad

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

◆ 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.

◆ origin

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

The origin of this tooltip

◆ rotation

float Terraria.ModLoader.DrawableTooltipLine.rotation = 0f

The rotation this tooltip would be drawn in

◆ text

new readonly string Terraria.ModLoader.DrawableTooltipLine.text

The text of this tooltip.

◆ X

int Terraria.ModLoader.DrawableTooltipLine.X

The X position where the tooltip would be drawn.

◆ Y

int Terraria.ModLoader.DrawableTooltipLine.Y

The Y position where the tooltip would be drawn.

Property Documentation

◆ Color

Color Terraria.ModLoader.DrawableTooltipLine.Color
getset

The color the tooltip would be drawn in

◆ OriginalX

int Terraria.ModLoader.DrawableTooltipLine.OriginalX
getset

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

◆ OriginalY

int Terraria.ModLoader.DrawableTooltipLine.OriginalY
getset

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

◆ 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