Button Elements#
Buttons provide an input element that a user can click on to perform an action or click on to toggle state (on/off).
Button elements have a single child element, but layout elements, such as boxes can be used to create complex content.
New buttons can be created with the button()
function in the
eg-overlay-ui
module.
Checkboxes#
Checkboxes are a specialized version of a button that displays a toggle (on or off) state.
Checkboxes can be created with the checkbox()
function.
Functions#
- eg-overlay-ui.button()#
Creates a new
uibutton
.- Return type:
Version History
Version
Notes
0.3.0
Added
- eg-overlay-ui.checkbox(size)#
Creates a new
uibutton
that is specialized as a checkbox.- Parameters:
size (
integer
) – The width/height of the checkbox.
Note
A checkbox button can’t have a child element and will send two additional events to event handlers:
toggle-on
toggle-off
Version History
Version
Notes
0.3.0
Added
Classes#
- class eg-overlay-ui.uibutton#
A button has a single child element and can be monitored for mouse events.
- addeventhandler(handler[, event1, event2, ...])#
- Parameters:
- Return type:
Version History
Version
Notes
0.3.0
Added
- removeevnthandler(handlerid)#
- Parameters:
handlerid (
integer
) – An event handler ID returned fromaddeventhandler()
Version History
Version
Notes
0.3.0
Added
- bghover(color)#
Set the color drawn for the button’s hovered background.
- Parameters:
color (
integer
)
Version History
Version
Notes
0.3.0
Added
- bghighlight(color)#
Set the color drawn for the button’s highlighted background.
- Parameters:
color (
integer
)
Version History
Version
Notes
0.3.0
Added
- border(color)#
Set the color drawn for the button’s border.
- Parameters:
color (
integer
)
Version History
Version
Notes
0.3.0
Added
- borderwidth(pixels)#
Set the border thickness.
- Parameters:
pixels (
integer
)
Version History
Version
Notes
0.3.0
Added
- checkstate([value])#
Get or set the state of this button if it is a checkbox.
Version History
Version
Notes
0.3.0
Added
Note
The following methods are inherited from
uielement
- x([position])#
Set or get the current position X.
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.
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.
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.
Important
It is normally not necessary to manually set an element’s size.
Version History
Version
Notes
0.3.0
Added