ComicPage.component
README.md
ComicPage
Holds the comic page's shared settings and, on every machine, runs that machine's own extra panel cameras. ComicPanels.setLayout puts it on a synced entity named ComicPanels; you do not normally add it by hand. It needs no sibling components, only styleKit with the panelPage block in the stack (which ComicPanels adds).
Fields (synced)
| Field | Default | What it is |
|---|---|---|
layout | "splash" | The layout id (ComicPanels.layouts()). |
cameras | "single" | single: every panel shows the game's one view. several: panels with a framing get a per-player extra camera. |
border | "" | Border style name, empty for the layout's own. |
gutter | "" | Gutter colour name or #rrggbb, empty for the page default. |
shown | true | Whether the page is shown. |
viewScale | 0.75 | Resolution of the extra views relative to their panel on screen, 0.25 to 1. Lower costs less. |
What it does each frame
When shown is on and cameras is several, it asks ComicPanels.plan which framings the layout needs (at most three). For each it spawns a local entity ComicPanelCamera<n> (network scope OwnerOnly, never synced) with a Camera of the framing's lens, rendering all !ui !EditorUI !debug into a texture sized to the panel's box on screen times viewScale, and publishes that texture to the style stack with StyleKit.publishInput("panelView<n>", texture). Every frame it places each camera around the local player's avatar (layers.active.players.localPlayer.avatar) from the framing's eye and look-at offsets and the avatar's facing.
It rebuilds the cameras when the layout, framings, viewScale or screen size change, and removes them (withdrawing the inputs and destroying the textures) when the camera mode is single, the page is hidden, or the component is destroyed. In single mode it spawns nothing.
Methods
views(): the extra views on this machine,{ { framing, width, height } }.
Multiplayer
The fields are synced, so every player sees the same page. The cameras are each machine's own and follow that machine's own player, so each player's close-up shows their own character. With no local avatar (a scene without players) the cameras stay where they were spawned.