ui-helpers#

local uih = require 'ui-helpers'

UI helper utility functions.

Functions#

ui-helpers.text(text[, color])#

Create a eg-overlay-ui.uitext using default font settings. If color is not specified, the default color will also be used.

If color is instead true then the default accent color will be used.

Parameters:
Return type:

eg-overlay-ui.uitext

Version History

Version

Notes

0.0.1

Added

0.1.0

Use accent color if ``color`` is ``true``

ui-helpers.monospace_text(text[, color])#

Create a eg-overlay-ui.uitext using default font settings for a monospace font. If color is not specified, the default color will be used.

If color is instead true then the default accent color will be used.

Parameters:
Return type:

eg-overlay-ui.uitext

Version History

Version

Notes

0.0.1

Added

ui-helpers.monospace_text_menu_item(text)#

Create a eg-overlay-ui.uimenuitem containing a eg-overlay-ui.text using the default font settings for a monospace font.

Parameters:

text (string)

Return type:

eg-overlay-ui.uimenuitem

Version History

Version

Notes

0.0.1

Added

ui-helpers.text_menu_item(text)#

Create a eg-overlay-ui.uimenuitem containing a eg-overlay-ui.text using the default font settings.

Parameters:

text (string)

Return type:

eg-overlay-ui.uimenuitem

Version History

Version

Notes

0.0.1

Added

ui-helpers.text_button(text)#

Create a eg-overlay-ui.uibutton containing a eg-overlay-ui.uitext using the default font settings.

Parameters:

text (string)

Return type:

eg-overlay-ui.uibutton

Version History

Version

Notes

0.0.1

Added

ui-helpers.checkbox()#

Create a eg-overlay-ui.uibutton that is specialized as a checkbox and automatically sized based on the default font settings.

Return type:

eg-overlay-ui.uibutton

Version History

Version

Notes

0.0.1

Added

ui-helpers.textentry([text[, hint]])#

Create a eg-overlay-ui.uitextentry using the default font settings.

Return type:

eg-overlay-ui.uitextentry

Version History

Version

Notes

0.1.0

Added

ui-helpers.colorsetalphaf(color, alpha)#

Set the alpha component of a color to the given value as a float.

Parameters:
  • color (integer) – A color.

  • alpha (float) – The new alpha value, from 0.0 to 1.0.

Return type:

integer

Version History

Version

Notes

0.1.0

Added

ui-helpers.rgbtorgba(rgbcolor[, alpha])#

Convert a 24bit RGB color to a 32bit RGBA color.

Parameters:
  • rgbcolor (integer) – A 24bit RGB color, ie. 0xFFFFFF

  • alpha (integer) – (Optional) An 8bit alpha value, ie. 0xFF. Default: 0xFF

Return type:

integer

Version History

Version

Notes

0.1.0

Added

ui-helpers.icon(name[, size[, color]])#

Create a text with an icon.

Icons are Google Material Symbols, loaded from a variable font file.

See https://fonts.google.com/icons for font names. The name must match the names in the codepoints file, that is they must be lower case with spaces replaced by underscore. I.e., Arrow Upward becomes arrow_upward.

Return type:

eg-overlay-ui.uitext

Version History

Version

Notes

0.1.0

Added