Open a preview on a phone and the scene lays out against the phone’s screen, as the engine would on that device. Nothing needs configuring.
The stage is the viewport
The size of the preview’s mount is the Roblox viewport. Loom feeds it to the layout engine and to
Workspace.CurrentCamera.ViewportSize. On a narrow screen:
- text re-wraps,
- a
UIListLayoutwithWrapsre-flows, AutomaticSizere-measures,- a scene that branches on
ViewportSizetakes its narrow path.
A layout of fixed offsets wider than the screen runs off the edge and is clipped, as it would on a
real device. The generated pages size with dvh, so the stage doesn’t hide under a mobile
browser’s toolbars.
Neither does Roblox. Make the scene adapt with a UIScale, a breakpoint on ViewportSize, or an
AbsoluteSize binding.
?base= keeps a wide composition
If you embed a preview at a narrow width and want the desktop layout shrunk to fit, add ?base=:
/loom-preview/index.html?target=src%2Fscenes%2FCounter.loom.tsx&chrome=none&base=1280| Value | Effect |
|---|---|
| absent | The default. The scene lays out against the real viewport. |
?base=<px> | Lay out at this width. Below it, the stage scales down to fit; at or above it, nothing changes. |
?base (bare) | Same as ?base=960. An unreadable value also means 960. |
?base=none (or off, or 0) | The default, spelled out, for a host page that always templates the param. |
A wider base keeps more of the desktop layout but draws everything smaller. At 960 a phone renders at about 40%; at 1280, about 30%, where body text stops being readable.
With a base, you see the wide layout drawn smaller, not the layout a phone would get. Text keeps its wide line breaks and wrapped rows keep their wide count.
The debug panel shows both the real and the logical size, and the
scale between them. ?base= is part of the
URL contract.
When the stage is scaled, loom converts pointer positions back to layout pixels, so clicks land
where the scene appears. That covers MouseEnter, Activated and InputChanged positions,
GetMouseLocation, and wheel deltas.
Touch
- A drag inside a
ScrollingFramescrolls it, with the same clamping as the mouse wheel. Past a small threshold the drag stops counting as a tap, so dragging across a button doesn’t activate it. - Only
ScrollingFrames capture touch panning. Everywhere else the page scrolls normally, so an embedded preview never traps the reader’s scroll. - Taps register immediately, without the browser’s ~300ms double-tap delay.
The gallery on a phone
In the full gallery, the 248px sidebar becomes a top bar with a targets button. Picking a target
closes it. With ?chrome=none there is no sidebar, so an embedded preview only gets the touch
handling.