Remove the component from rendering.
If the Component supports it, this can be reverted with restore() method.
Object itself for fluent interface.
Get auto dispose behavior for this UI element.
Auto dispose mode.
Get dragging mode of object. Defines how the object can be dragged by mouse.
Object itself
Get boolean flag for whether object is currently under mouse or not
Boolean for is object under mouse currently
Get margin around object in pixels.
Margin datastructure
Mouse interactions state
Get mouse style.
Interface for defining how mouse should look when hovering over UI object
Returns the position origin of this UiElement.
Relative position vector (-1 to 1, where 0 is center of the object).
Returns the position of this UiElement at given location relative to elements size.
Relative position vector (-1 to 1 which specifies position of origin, 0 is center of the object)
Parameter to disregard parts of object when calculating the asked position. Defaults to Margin.
Object itself for fluent itself
Returns the size of the UiElements in pixels including any Margins or Paddings
Parameter to disregard parts of object when calculating the position. Defaults to Margin, which includes everything. Should only ever be necessary for sub-classes
Object size in pixels
True if the component is currently disposed, and thus not being rendered. If the Component supports it, this can be reverted with restore() method.
Remove event listener from Mouse Click Event
Token of event listener which has to be removed
True if the listener is successfully removed and false if it is not found
Remove event listener from Mouse Double Click Event
Token of event listener which has to be removed
True if the listener is successfully removed and false if it is not found
Remove event listener from Mouse Down Event
Token of event listener which has to be removed
True if the listener is successfully removed and false if it is not found
Remove event listener from Mouse Drag Event
Token of event listener which has to be removed
True if the listener is successfully removed and false if it is not found
Remove event listener from Mouse Drag Start Event
Token of event listener which has to be removed
True if the listener is successfully removed and false if it is not found
Remove event listener from Mouse Drag Stop Event
Token of event listener which has to be removed
True if the listener is successfully removed and false if it is not found
Remove event listener from Mouse Enter Event
Token of event listener which has to be removed
True if the listener is successfully removed and false if it is not found
Remove event listener from Mouse Leave Event
Token of event listener which has to be removed
True if the listener is successfully removed and false if it is not found
Remove event listener from Mouse Move Event
Token of event listener which has to be removed
True if the listener is successfully removed and false if it is not found
Remove event listener from Mouse Up Event
Token of event listener which has to be removed
True if the listener is successfully removed and false if it is not found
Remove event listener from Mouse Wheel Event
Token of event listener which has to be removed
True if the listener is successfully removed and false if it is not found
Remove event listener from Touch End Event
Token of event listener which has to be removed
True if the listener is successfully removed and false if it is not found
Remove event listener from Touch Move Event
Token of event listener which has to be removed
True if the listener is successfully removed and false if it is not found
Remove event listener from Touch Start Event
Token of event listener which has to be removed
True if the listener is successfully removed and false if it is not found
Subscribe to Mouse Click event
Function that will be called when mouse clicks the bounds of UiObject.
Token-object that is a reference ID to the listener created.
Subscribe to Mouse Double Click event
Subscribe to Mouse Down event
Subscribe to Mouse Drag event
Subscribe to Mouse Drag Start event
Subscribe to Mouse Drag Stop event
Subscribe to Mouse Enter event
Function that will be called when mouse enters the bounds of UiObject.
Token-object that is a reference ID to the listener created.
Subscribe to Mouse Leave event
Function that will be called when mouse leaves the bounds of UiObject.
Token-object that is a reference ID to the listener created.
Subscribe to Mouse Move event
Event handler function
Token of subscription
Subscribe to Mouse Up event
Subscribe to Mouse Wheel event
Event handler function
Token of subscription
Subscribe to Touch End event
Event handler function
Token of subscription
Subscribe to Touch Move event
Event handler function
Token of subscription
Subscribe to Touch Start event
Event handler function
Token of subscription
After the Components dispose() method has been called, removing it from rendering, restore() can be used to return it back.
Object itself for fluent interface.
Set auto dispose behavior for this UI element.
Can be used to set a condition, where the UI element is automatically disposed, removing it from view.
// Example, remove UI element when it is larger than 20% of viewport.
UIElement.setAutoDisposeMode({
type: 'max-width',
maxWidth: 0.20,
})
Auto dispose mode.
Object itself for fluent interface.
Set dragging mode of object. Defines how the object can be dragged by mouse.
See UIDraggingModes collection for options.
DraggingMode or undefined to disable dragging
Object itself
Set margin around object in pixels.
Number with pixel margins for all sides or datastructure with individual pixel margins for each side. Any side can be omitted, only passed values will be overridden.
Object itself
Set mouse interactions enabled. Implementations should update the mouse-interactions of any Shapes they may contain here.
Set mouse style when hovering over UI object.
Interface for defining how mouse should look when hovering over UI object
Object itself
Sets the position origin of this UiElement.
Relative position vector (-1 to 1, where 0 is center of the object). UIOrigins, enum-like object can be used for easy selection of common values
Sets the position of this UiElement relative to its origin
Position
Interface for a stand-alone UIElement.
Adds ability for: