Panel.SetFont
From GMod Wiki
Function | |
Syntax | Panel:SetFont( String font ) |
Description: | |
Sets the font of all text on the panel. | |
Returns: | nil |
In Object: | Panel |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Panel.SetFont]Panel.SetFont [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Set's the font. |
---|---|
Used on | Labels, TextEntry & Buttons. |
Code | local label = vgui.Create("DLabel") label:SetText("Hello") label:SetPos(5,5) label:SetFont("defaultbold") label:SizeToContents() |
Output | "Hello" in the font "defaultbold" |
Additional Notes
- Click here for more information about fonts.
- This works on the following controls: P.Label, P.TextEntry, P.Button, P.ToggleButton
- Please add to the list above if you know more.