cityRPTooltipRow
Text container for cityRPTooltip
.
Rows are the main way of interacting with cityRPTooltip
s. These derive from
DLabel panels, which means that making use of this panel
will be largely the same as any DLabel panel.
This has been taken from Helix: https://github.com/NebulousCloud/helix/blob/master/gamemode/core/derma/cl_tooltip.lua
Functions
cityRPTooltipRow:IsMinimal()
View source »Whether or not this tooltip row should be displayed in a minimal format. This usually means no background and/or
smaller font. You probably won't need this if you're using regular cityrpTooltipRow
panels, but you should take into
account if you're creating your own panels that derive from cityrpTooltipRow
.
Returns
-
bool
True if this tooltip row should be displayed in a minimal format
cityRPTooltipRow:Paint(width, height)
View source »Called when the foreground of this row should be painted. If you are overriding this in a subclassed panel,
make sure you call cityrpTooltipRow:PaintBackground
at the beginning of your function to make its style
consistent with the rest of the framework.
Parameters
-
width
number
Width of the panel
-
height
number
Height of the panel
cityRPTooltipRow:PaintBackground(width, height)
View source »Called when the background of this row should be painted. This will paint the background with the
DrawImportantBackground
function set in the skin by default.
Parameters
-
width
number
Width of the panel
-
height
number
Height of the panel
cityRPTooltipRow:SetBackgroundColor(color)
View source »Sets the background color of this row. This should be used sparingly to avoid overwhelming players with a bunch of different colors that could convey different meanings.
Parameters
-
color
Color
New color of the background. The alpha is clamped to 100-255 to ensure visibility
cityRPTooltipRow:SetImportant()
View source »Sets this row to be more prominent with a larger font and more noticable background color. This should usually be used once per tooltip as a title row. For example, item tooltips have one "important" row consisting of the item's name. Note that this function is a fire-and-forget function; you cannot revert a row back to it's regular state unless you set the font/colors manually.
cityRPTooltipRow:SizeToContents()
View source »Resizes this panel to fit its contents. This should be called after setting the text.
cityRPTooltipRow:SizeToContentsY()
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Resizes the height of this panel to fit its contents.