Label: Difference between revisions

From Empires Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 34: Line 34:
== See Also ==
== See Also ==
* https://developer.valvesoftware.com/wiki/Understanding_VGUI2_Resource_Files#Label
* https://developer.valvesoftware.com/wiki/Understanding_VGUI2_Resource_Files#Label
[[Category:VGUI Elements]]

Revision as of 04:08, 8 August 2017

Displays text. Inherits all properties from Panel.

Tips

If you set the labelText to a value starting with # the corresponding translated string will be looked up and displayed instead. Try to keep in mind that strings in other languages can have different lengths.

Special Properties

  • labelText: Determines the text that the label will display.
  • textAlignment: Determines the alignment of the label. Valid values are north-west, north, north-east, west, center, east, south-west, south and south-east.
  • associate: Allows the label to be associated with another control. Fill in the fieldName of the element you want to focus on when this label is clicked.
  • dulltext: A boolean that determines if text should be displayed in a dull manner. Cannot be used together with brighttext.
  • brighttext: A boolean that determines if text should be displayed in a bright manner. Cannot be used together with dulltext.
  • font: Determines the font used by the label. Use the font name as defined in the SourceScheme.res file.
  • wrap: Determines if your label wraps around the available space.
  • centerwrap: Same as above, except it also works for centered text.
  • textinsetx: Additional horizontal offset space from whichever side it is aligned.
  • textinsety: Additional vertical offset space from whichever side it is aligned.

Example

"HudMinesLabel"
{
	"ControlName"		"Label"
	"fieldName"		"HudMinesLabel"
	"font" 		"HudMines"
	"xpos"		"2"
	"ypos"		"0"
	"wide"		"126"
	"tall"		"17"
	"autoResize"		"0"
	"textAlignment"		"west"
}

See Also