Positioning scale
Set size of PointMarker
Dispose object, ceasing its operation while keeping the object intact until call of 'restore'.
Object itself for fluent interface
Fit object to bounding box.
Bounds in pixels
Object itself
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 fill style of Picture
Highlight FillStyle of the object or undefined for auto assignment
True for highlighted state of object and false for basic
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
Get the position origin of this UiElement. Affects how the "position" of UIElement is interpreted.
Vec2 with each plane in range [-1, 1], where 0 is middle
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, which includes everything. Should only ever be necessary for other UiElements
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
Get stroke style of Picture
Highlight LineStyle of the object or undefined for auto assignment
True if all sub elements are disposed, false if not.
Unsubscribe from Highlight object event. This is called whenever an object is highlighted
Token that was received when subscribing to the event.
True if the unsubscription was successful.
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 highlight object event. This is called whenever an object is highlighted.
Function that is called when event is triggered.
Token that can be used to unsubscribe from the event.
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
Restore object if it was previously disposed.
Object itself 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 UIDraggingModescollection for options.
DraggingMode or undefined to disable dragging
Object itself
Set fill style of Picture
Fill style object or function which modifies it
Object itself for fluent interface
Set highlight fill style of object filling
FillStyle for highlighted object or mutator to modify existing one or undefined for auto assignment
Object itself for fluent interface
Set highlighted state of the Object
Highlight state of the object
Object itself for fluent interface
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 or disabled
Specifies state of mouse interactions
Object itself for fluent interface
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 of this UiElement relative to its origin.
NOTE: UIElements scale can't be changed apart from when it is created.
Location on the UIElements scale, where its origin should be positioned
Object itself
Set stoke style of Picture
LineStyle object or function which modifies it
Object itself for fluent interface
Set stroke style of object when it is highlighted
LineStyle for highlighted object or mutator to modify existing one or undefined for auto assignment
Object itself for fluent interface
Circular UI shape that can be used as Background and as Button picture.