Clears the UI, i.e. removes all the elements it contains.
Creates and adds a text element (i.e. UITextElement object) to the UI.
The Font to use for the text element
The text to be displayed. This can be dynamically changed later with UITextElement.setText()
Creates and adds a VoxelObject element (i.e. UIVoxelObjectElement object) to the UI.
The VoxelObject to be displayed.
Gets all the UITextElements that exist in the UI.
When provided, return the elements in this array instead of allocating one.
Gets all the UIVoxelObjectElement that exist in the UI.
When provided, return the elements in this array instead of allocating one.
Indicates if the game's UI is currently set to be visible by UI.setVisible.
Remove a given element from the UI.
The element to remove from the UI.
Makes the UI visible or invisible. This is separate from the "No Ingame 2d UI" debug setting in the editor. Both need to be set to visible in order for the UI to be visible.
Returns a position expressed in canvas space (i.e. in CSS pixels from the top-left corner.) from a UI-position (i.e. position on screen in normalized coordinates), See also: canvasToUIPos.
The position in normalized UI units to convert to CSS pixels.
When provided, returns the value in this Vector2 instead of allocating one.
Returns a UI-position (i.e. position on screen in normalized coordinates) from a position expressed in world units. The return value is a Vector3, and not a Vector2 as one might expect. This is because the z component indicates whether the point is visible or not. If it's less than 1, it is in front of the camera and therefore potentially visible (it might still be outside the camera frustum). If it's more than 1, it is behind the camera and thus necessarily invisible.
The world-unit position to convert to UI-position units.
When provided, return the UI-position in this Vector3 instead of allocating one.
Returns a UI-position (i.e. position on screen in normalized coordinates) from a position expressed in canvas space, i.e. in CSS pixels from the top-left corner. See also: uiPosToCanvas.