Class gui
Extends
component.
gui
Defined in: gui.js.
Constructor Attributes | Constructor Name and Description |
---|---|
gui()
A component that provides managed input interaction suitable for
making things like buttons, text boxes, etc.
|
Field Attributes | Field Name and Description |
---|---|
Returns whether the user is attempting to drag this gui.
|
|
Whether the pointer clicked in this gui's rectangular region.
|
|
Whether the gui is focused.
|
|
The height of the gui in 2D coordinates.
|
|
Whether the pointer is hovered over the gui's region.
|
|
The local node of this component.
|
|
The text to appear above a widget if the mouse hovers over it.
|
|
The width of the gui in 2D coordinates.
|
- Fields borrowed from class component:
- host, info, isDrawing, isStepping, onAttach, onDraw, onStep, tag
Method Attributes | Method Name and Description |
---|---|
Attempts to grab the input focus for this GUI.
|
|
setFocus()
Sets this GUI to be the focused widget.
|
- Methods borrowed from class component:
- canHandleEvent, draw, emitEvent, getKnownEvents, installEvent, installHandler, installHook, step, uninstallEvent, uninstallHandler, uninstallHook
Class Detail
gui()
A component that provides managed input interaction suitable for
making things like buttons, text boxes, etc.
Known component events:
- "on-click" - "on-enter" - "on-leave" - "on-drag" - "on-focus" - "on-unfocus"
Field Detail
beingDragged
Returns whether the user is attempting to drag this gui.
clicked
Whether the pointer clicked in this gui's rectangular region. The property is read-only.
focused
Whether the gui is focused. This property is read-only.
height
The height of the gui in 2D coordinates.
hovered
Whether the pointer is hovered over the gui's region. This property is read-only.
node
The local node of this component.
tooltipText
The text to appear above a widget if the mouse hovers over it.
width
The width of the gui in 2D coordinates.
Method Detail
grabInput()
Attempts to grab the input focus for this GUI.
If a GUI grabs the input focus, other GUI's will not have input events pushed
to them. See sandboxe.gui.ungrabInput to ungab input from all gui objects globally.
setFocus()
Sets this GUI to be the focused widget.
Focusing has no inate effect on the GUI except for the return values
from the focus-related set of properties and events.