Text
Sets a panel's text. If the panel has text methods (SetText
, SetFont
, etc.) it will use those. Otherwise, this class will directly apply the text through the panel's Paint function.
Arguments
String text
Self explanatory
(Optional) String font
Font which the text will use
(Optional) Color col
Color of the text
(Optional) Number alignment
Alignment of the text, uses TEXT_ALIGN
enums
(Optional) Number ox
Pixel offset to apply to the x plane
(Optional) Number oy
Pixel offset to apply to the y plane
(Optional) Boolean paint
Force the panel to paint the text instead of just set it (panels which support text methods, like labels and buttons)
Example
local pnl = vgui.Create("DPanel")
pnl:ClearPaint()
:Background(Color(0, 0, 0, 200))
:Text("Left with an offset", "DermaLarge", Color(0, 255, 0), TEXT_ALIGN_LEFT, 5)