Skip to content

LoomView & input

LoomView is a Unity component that:

  • Displays your UI as a transparent overlay over the game scene.
  • Captures mouse, keyboard, and touch input and forwards it to the UI.

You don’t write a LoomView yourself — you add one to your scene via Loom → Setup UI in Current Scene, which creates a canvas with LoomView and a LoomInputCapture already wired up.

How input works

LoomInputCapture polls Unity input each frame (both Legacy Input Manager and the new Input System are supported). When the cursor is over the LoomView canvas, it forwards:

  • Mouse move, click, scroll
  • Keyboard key down, key up (with full DOM event semantics)
  • Modifier state (shift, ctrl, alt, meta)
  • Touch events on mobile

Input that the UI doesn’t consume — for example, a mouse click that lands on a transparent pixel — falls through to your game scene. Specifically: an element with pointer-events: none (CSS) or transparent under the cursor will let the event through. Use this to make HUDs interactive only where they have visible elements.

Transparency

The UI is composited on top of the game scene with full alpha. To make a region transparent, simply give it background: transparent and no opaque children. The HUD screen in the sample is a good example — most of the screen shows the game beneath; only the bars, score, and ability rings are opaque.

DPI

The view auto-scales to match the game’s logical resolution. On retina displays, the UI renders at native pixel density. CSS 1px corresponds to one game logical pixel — which on a retina display is rendered through 2x pixels for sharpness.

Multiple views

You can have multiple LoomView instances in a scene (e.g. one for the HUD and one for a pause menu overlay). Switch between them by enabling and disabling the components.

In practice this is rarely needed — Solid’s screen routing inside one view covers most cases.