ixTooltip
Generic information panel.
Tooltips are used extensively throughout Helix: for item information, character displays, entity status, etc. The tooltip system can be used on any panel or entity you would like to show standardized information for. Tooltips consist of the parent container panel (ixTooltip), which is filled with rows of information (usually ixTooltipRow, but can be any docked panel if non-text information needs to be shown, like an item's size).
Tooltips can be added to panel with panel:SetHelixTooltip()
. An example taken from the scoreboard:
panel:SetHelixTooltip(function(tooltip)
local name = tooltip:AddRow("name")
name:SetImportant()
name:SetText(client:SteamName())
name:SetBackgroundColor(team.GetColor(client:Team()))
name:SizeToContents()
tooltip:SizeToContents()
end)
Functions
ixTooltip:AddRow(id)
View source »Creates a new ixTooltipRow panel and adds it to the bottom of this tooltip.
Parameters
-
id
string
Name of the new row. This is used to reorder rows if needed
Returns
-
panel
Created row
ixTooltip:AddRowAfter(after, id)
View source »Creates a new ixTooltipRow and adds it after the row with the given id
. The order of the rows is set via
setting the Z position of the panels, as this is how VGUI handles ordering with docked panels.
Parameters
-
after
string
Name of the row to insert after
-
id
string
Name of the newly created row
Returns
-
panel
Created row
ixTooltip:GetCursorPosition()
View source »Returns the current position of the mouse cursor on the screen.
Returns
-
number
X position of cursor
-
number
Y position of cursor
ixTooltip:GetRow(id)
View source »Returns an ixTooltipRow corresponding to the given name.
Parameters
-
id
string
Name of the row
Returns
-
panel
Corresponding row
-
nil
If the row doesn't exist
ixTooltip:IsMinimal()
View source »Whether or not this tooltip should be displayed in a minimal format.
Returns
-
bool
True if this tooltip should be displayed in a minimal format
See Also
ixTooltip:SetEntity(entity)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Sets the entity associated with this tooltip. Note that this function is not how you get entities to show tooltips.
Parameters
-
entity
Entity
Entity to associate with this tooltip
ixTooltip:SizeToContents()
View source »Resizes the tooltip to fit all of the child panels. You should always call this after you are done adding all of your rows.