Garry's Mod Wiki

RichText

Description

A very versatile text display element that's used to power the default chat and console.

Rich Text panels allows multicolored, highlight-able, and interactive text using individual text segment markup (segments are defined by the Panel:AppendText method).

Parent

Derives from Panel.

Example

Creates a Rich Text frame with 3 text segments.

-- Window frame for containing text local frame = vgui.Create("DFrame") frame:SetSize(200, 150) frame:Center() frame:MakePopup() -- Rich Text panel local richtext = vgui.Create( "RichText", frame ) richtext:Dock( FILL ) -- Text segment #1 (grayish color) richtext:InsertColorChange(192, 192, 192, 255) richtext:AppendText("This \nRichText \nis \n") -- Text segment #2 (light yellow) richtext:InsertColorChange(255, 255, 224, 255) richtext:AppendText("AWESOME\n\n") -- Text segment #3 (red ESRB notice localized string) richtext:InsertColorChange(255, 64, 64, 255) richtext:AppendText("#ServerBrowser_ESRBNotice")

Page Links


Special Pages


Wikis

?

Render Time: 31ms

DB GetPage 4
Generate Html 2
SaveChanges (1) 10
Render Body 0
Render Sidebar 11