The horizontal anchor point of the UI. Determines where positionX is in relation to the UI: for 0 it is at the left side, 0.5 is at the center, 1.0 is the right side. Default: 0
The vertical anchor point of the UI. Determines where positionY is in relation to the UI: for 0 it is at the top, 0.5 is at the center, 1.0 is the bottom. Default: 0
Height to use for rendering the UI. Can be in pixels or relative to the screen size. Default: 90
Determine which players see the UI. By default, it will be shown for all players (except for VR players).
The X position of the UI element on the screen. Can be in pixels or relative to the screen size.
The X position of the UI element on the screen. Can be in pixels or relative to the screen size.
If true, height is relative to the screen (or window) size instead of in pixels, where the whole screen is 1.0 units high. Default: false
If true, positionX is relative to the screen (or window) size instead of in pixels, where the whole screen is 1.0 units wide. Default: true
If true, positionY is relative to the screen (or window) size instead of in pixels, where the whole screen is 1.0 units high. Default: true
If true, width is relative to the screen (or window) size instead of in pixels, where the whole screen is 1.0 units wide. Default: false
The main widget of this component
Width to use for rendering the UI. Can be in pixels or relative to the screen size. Default: 160
Represents a UI element on the screen. Can be added to the screen using GameWorld.addScreenUI. If you want to modify values of the UI element after adding it, for example to modify its location, you need to call GameWorld.updateScreenUI afterwards to apply the update.
You can't modify the widget property as an update, but you can change properties of the widget without needing to call updateScreenUI.
Screen UI elements are not visible for VR players, because there is no screen in VR where they could be attached. Don't use screen UI for elements that are required for playing, or VR players won't be able to play properly! You can also check whether a player is using VR with Player.isUsingVR and add a 3D UI only for VR players using UIElement.players.