Link Search Menu Expand Document

Control: Label

The Label control is a simple text display.

Example

<!-- Simple text -->
<Label text="Sample Text"/>

<!-- Localized strings -->
<Label text="#PORTAL2_NewGame"/>

Properties

NameTypeDescription
textstringThe text to display
htmlboolWhether or not the text should be parsed as html

Methods

SetLocalizationString

Assign a localization string to the label

myLabel.SetLocalizationString( "PORTAL2_NewGame" );

SetProceduralTextThatIPromiseIsLocalizedAndEscaped

Yes that’s an actual function name. Assigns raw text to a label. Use with caution.

myLabel.SetProceduralTextThatIPromiseIsLocalizedAndEscaped( "Some text that should not be processed" );