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. Ifcolor
is not specified, the default color will also be used.If
color
is insteadtrue
then the default accent color will be used.- Parameters:
- Return type:
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. Ifcolor
is not specified, the default color will be used.If
color
is insteadtrue
then the default accent color will be used.- Parameters:
- Return type:
Version History
Version
Notes
0.0.1
Added
Create a
eg-overlay-ui.uimenuitem
containing aeg-overlay-ui.text
using the default font settings for a monospace font.- Parameters:
text (
string
)- Return type:
Version History
Version
Notes
0.0.1
Added
Create a
eg-overlay-ui.uimenuitem
containing aeg-overlay-ui.text
using the default font settings.- Parameters:
text (
string
)- Return type:
Version History
Version
Notes
0.0.1
Added
- ui-helpers.text_button(text)#
Create a
eg-overlay-ui.uibutton
containing aeg-overlay-ui.uitext
using the default font settings.- Parameters:
text (
string
)- Return type:
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:
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:
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:
- Return type:
Version History
Version
Notes
0.1.0
Added
- ui-helpers.rgbtorgba(rgbcolor[, alpha])#
Convert a 24bit RGB color to a 32bit RGBA color.
- Parameters:
- Return type:
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
becomesarrow_upward
.- Return type:
Version History
Version
Notes
0.1.0
Added