Modbox

Modbox

Modbox is a multiplayer game-building sandbox for PC / VR / AR. Currently in private alpha.

Guides    

UI Editing

  • The 'Core UI' mod includes UI Entities which can be used to be build UI such as the player's HUD, menu screens, and other ingame displays.

  • UI Entities have to be in a UI CanvasUI Canvas - A UI Canvas entity contains UI entities. It can then be added to Player Avatars to show on their screen as a HUD while playing - or as a UI screen. entity.

  • The 'UI Canvas' can be set to 'Screen Overlay' mode - which will then show it on the Screen for all users (but not in VR player headsets). To create a HUD / UIScreen - a PrefabPrefab - Prefabs are entity assets created ingame out of 1 or more other entities. Prefabs can then be shared online / between creations. (There is also Unity's Prefab system used in the ModboxSDK, which is different but same functionality) needs to be created of the canvas

A UI Canvas is placed in the world then the UI entities are added to it. Here a NumberBar is added to be used to display health.A UI Canvas is placed in the world then the UI entities are added to it. Here a NumberBar is added to be used to display health.

A UI Canvas is placed in the world then the UI entities are added to it. Here a NumberBar is added to be used to display health.

Alignment

  • One important aspect of creating UI is setting the Alignment. By default UI entities align to the center - but when creating a HUD you might want to align to the bottom / top / right / left. This is important since the Canvas will be displayed at different sizes depending on the players resolution.
Can set the alignment in the 'UI Transform' componentCan set the alignment in the 'UI Transform' component

Can set the alignment in the 'UI Transform' component

UI Prefabs

  • To create a HUD / UI Screen for users, create a Prefabs of the UI Canvas.

  • To set this prefab as the default HUD for all players - set 'Default HUD' in 'Players' section of Creation Settings. This will then add that HUD to the player when they start playing.

  • To add a HUD to a specific player - add a EntPlayerHUD component to the User/Avatar and set the prefab as 'UseCanvases' list

  • The Wiring system and MBScript can be used to control the UI and what it displays.

UI Screens

  • To create a UI ScreenUI Screen - UI Screens are screens that show to the users in the center and block gameplay. Players have 1 UI screen open at a time and can be navigated Forward/Back through screens. Each local User (screen and VR) has their UI Screen Canvas that shows UI Screens. - in the 'Assets' screen create a new 'UI Screen Entity Canvas' asset. Then set it's 'Canvas Prefab' to the UI Prefab
  • A UI Screen can be set to be 'Show In Menu Options' - so it will shown as a option when the user has their menu open
  • UI Screens can be shown to a User through MBScriptMBScript - MBScript is the visual scripting system for creating new Components on Entities by using 'User.ShowScreen('
  • In Creation Settings - a UI Screen can be set as the 'Game Menu'. It will then show as a option to open while playing (as a input hint on the screen to open for screen players with Tab, or as a button on a VR controller)

Updated about a month ago

UI Editing


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.