OasisWManual 한국어
Section 8. UI and sound Pending 3

How on-screen text and buttons are structured

UI that sits on top of the game screen, such as scores, messages and buttons, is built by placing entities with an Element component under an entity with a Screen component. This page explains how the two components relate and how positions are set. The steps for building them are in Change score and message text and Make a button.

Screen and Element

ComponentAttached toWhat it does
SCREENThe top entity of a UI group (e.g. 2D Screen)Whether the UI sticks to the screen or sits in 3D space, and how the UI stretches when the screen size changes
ELEMENTEach entity under the ScreenOne of text (Text), image (Image) or empty group (Group). Position, size and reference point
BUTTONAn entity with an Image ElementReceives presses and changes color on hover and press

An Element is drawn on screen only if it is under a Screen. If you create it with HIERARCHY + → User Interface, this structure is set up automatically. The menu contains 2D Screen, 3D Screen, Button, Layout Group, Layout Child, Group Element, Text Element, Image Element, Scrollbar and Scroll View.

2D Screen and 3D Screen

The Screen Space field of SCREEN distinguishes the two. It is on when you create a 2D Screen.

  • Screen Space on: sticks to the screen regardless of the camera. Use it for scores and buttons.
  • Screen Space off (3D Screen): becomes a panel placed at a spot in the scene. Use it for name tags above heads or in-game signs. Pending Test 3D Screen

Fitting the screen size

The SCREEN fields of a new 2D Screen are as follows (checked on 2026-10-29).

FieldDefaultMeaning
Ref Resolution1280 × 720Reference screen size the UI is designed for
Scale ModeBlendHow the UI stretches when the actual screen differs from the reference. None or Blend
Scale Blend0.5Whether to fit width or height (0 = width, 1 = height)
Priority0Draw order when there are several Screens

Scale factor tests

On 2026-10-29 we read the Screen's scale factor in a launched game window (1920 × 854) (1 run).

SettingScale factorMeaning
None1Reference pixels as-is regardless of screen size. The UI looks small on large screens
Blend, Scale Blend 01.5Fits the width ratio (1920 ÷ 1280)
Blend, Scale Blend 11.186Fits the height ratio (854 ÷ 720)
Blend, Scale Blend 0.5 (default)1.334Between the two ratios (geometric mean)

If text gets cut off on tall screens such as phones, move Scale Blend toward 0 (width-based). Pending Test on a phone in portrait

Positioning: Anchor and Pivot

An Element's position is set by which point of the parent area it attaches to (Anchor) and which point of itself lines up with that spot (Pivot). Both are 0–1 ratios. 0, 0 is the bottom left and 1, 1 is the top right.

  • A new Element is created in the center of the screen with Preset Center Anchor & Pivot (all four Anchor values 0.5, Pivot 0.5, 0.5).
  • Choosing Top Left Anchor & Pivot in Preset attaches it to the top-left corner. Use this for text that sits in a corner, like a score. The distance from the corner stays the same when the screen size changes.
  • Choosing Stretch fills the parent area. Use it for semi-transparent background panels.

In our tests, setting a Text's Anchor to 0, 1, 0, 1 and Pivot to 0, 1 (= Top Left Anchor & Pivot) and its Position to 20, -20 placed the text slightly in from the top-left corner of the screen.

A red 점수 (Score) and a white 10 at the top left of the launched game screen
Score text pinned to the top left. 점수 (Score) is colored with Enable Markup

Draw order and input

  • Under the same Screen, the Element lower in HIERARCHY is drawn on top. In our tests, a Button created later covered a Text created earlier (1 run).
  • To receive presses, the Element's Use Input must be on. It is on when you create a Button.
  • UI is drawn on the UI layer. The camera's Layers must include UI for it to be visible.

UI in games made by the AI

All 7 games the AI made in the contest editor displayed scores with this structure (Text Element under a Screen), and none had UI built with HTML/CSS. To change the text, see Change score and message text. Pending Recheck with 3 AI games on the current version

Next steps

Source ui-sound/ui-overview.html