Text Elements#

Text elements display text in a single font and color. Multiple text elements can be combined with layout elements to create content with multiple fonts/colors.

A new text element can be created with the text() function in the eg-overlay-ui module.

See also

See Fonts for details on how EG-Overlay handles and renders fonts.

Functions#

eg-overlay-ui.text(text_value, color, font)#

Create a new :lua:class:’uitext’ element.

Parameters:
  • text (string) – The text string to display.

  • color (integer) – Text color. See Colors.

  • font (uifont) – The font to use to render the text. See uifont.

Returns:

A Text element

Version History

Version

Notes

0.0.1

Added

Classes#

class eg-overlay-ui.uitext#

A text element

text([newtext])#

Get or set the text displayed in this text.

Parameters:

newtext (string) – The new text to display.

Returns:

The current or new text.

Version History

Version

Notes

0.2.0

Added

Note

The following methods are inherited from uielement

x([position])#

Set or get the current position X.

Parameters:

position (integer) – (Optional)

Return type:

integer

Important

It is normally not necessary to manually position an element.

Version History

Version

Notes

0.3.0

Added

y([position])#

Set or get the current position Y.

Parameters:

position (integer) – (Optional)

Return type:

integer

Important

It is normally not necessary to manually position an element.

Version History

Version

Notes

0.3.0

Added

width([value])#

Get or set the element’s width.

Parameters:

width (integer) – (Optional)

Return type:

integer

Important

It is normally not necessary to manually set an element’s size.

Version History

Version

Notes

0.3.0

Added

height([value])#

Get or set the element’s height.

Parameters:

width (integer) – (Optional)

Return type:

integer

Important

It is normally not necessary to manually set an element’s size.

Version History

Version

Notes

0.3.0

Added

bgcolor([color])#

Get or set the element’s background color.

Parameters:

color (integer) – (Optional)

Return type:

integer

Version History

Version

Notes

0.3.0

Added