focusRing(style: any, radius: number?) → any
Copy the focus ring into a style table (returns it).
| arg | type | description |
|---|
| style | any | |
| radius | number? | |
screen( ) → void
The canvas the hangout's screens lay out on, in logical points (follows a phone's size and turn).
barReserve( ) → number
Height the controls bar takes at the bottom of the screen (it wraps to two rows on a
narrow one): a panel keeps its buttons above it.
text(text: string, style: any?, wrap: boolean?) → any
| arg | type | description |
|---|
| text | string | |
| style | any? | |
| wrap | boolean? | |
kicker(text: string, colour: string?) → any
| arg | type | description |
|---|
| text | string | |
| colour | string? | |
onDevice(fn: (string) → void
Call `fn(device)` whenever the player switches between keyboard, pad and touch.
| arg | type | description |
|---|
| fn | (string | |
padLabel(button: string) → string
| arg | type | description |
|---|
| button | string | |
keyName(code: string) → string
| arg | type | description |
|---|
| code | string | |
keycap(key: string, size: number?) → any
One key as a raised keycap.
| arg | type | description |
|---|
| key | string | |
| size | number? | |
svgNode(svg: string, w: number, h: number) → any
| arg | type | description |
|---|
| svg | string | |
| w | number | |
| h | number | |
faceButton(button: string, h: number) → any
| arg | type | description |
|---|
| button | string | |
| h | number | |
pill(text: string, h: number, trigger: boolean?) → any
| arg | type | description |
|---|
| text | string | |
| h | number | |
| trigger | boolean? | |
dpad(dir: string?, h: number) → any
| arg | type | description |
|---|
| dir | string? | |
| h | number | |
a(name: string, d: string) → string
| arg | type | description |
|---|
| name | string | |
| d | string | |
stick(side: string, h: number, click: boolean?) → any
| arg | type | description |
|---|
| side | string | |
| h | number | |
| click | boolean? | |
mouse(part: string?, h: number) → any
| arg | type | description |
|---|
| part | string? | |
| h | number | |
fill(p: string) → string
| arg | type | description |
|---|
| p | string | |
padGlyph(button: string, h: number) → any
| arg | type | description |
|---|
| button | string | |
| h | number | |
padGlyph(spec: string, size: number?) → any
One pad button by its canonical name: "south", "left_shoulder", "dpad_up", "start", "stick:left".
| arg | type | description |
|---|
| spec | string | |
| size | number? | |
kbmGlyph(spec: string, size: number?) → any
One keyboard/mouse input: a key code ("KeyE", "Space"), "mouse:left", "mouse:wheel", "mouse", "wasd", "arrows".
| arg | type | description |
|---|
| spec | string | |
| size | number? | |
specsOf(b: any, out: { string }, pad: boolean) → void
a binding entry (what an .inputBinding's kbm / gamepad list holds) as glyph specs
| arg | type | description |
|---|
| b | any | |
| out | { string } | |
| pad | boolean | |
binding(path: string) → any
| arg | type | description |
|---|
| path | string | |
specs(item: any, device: string?) → void
The glyph specs an item shows on `device`: from its `bind` (an .inputBinding
path or alias, or a list of them) unless `kbm` / `pad` spell them out.
| arg | type | description |
|---|
| item | any | |
| device | string? | |
glyphs(item: any, size: number?, device: string?) → any
The glyph row for one item on the current device (nil on touch or when nothing is bound).
| arg | type | description |
|---|
| item | any | |
| size | number? | |
| device | string? | |
keys(keys: { string }, size: number?) → any
legacy: keycaps for literal keys
| arg | type | description |
|---|
| keys | { string } | |
| size | number? | |
glass(children: { any }, style: any?, props: any?) → any
| arg | type | description |
|---|
| children | { any } | |
| style | any? | |
| props | any? | |
bar(frac: number, width: number, colour: string?) → any
| arg | type | description |
|---|
| frac | number | |
| width | number | |
| colour | string? | |
ring(frac: number, size: number, text: string, colour: string?) → any
A ring filled to `frac` around `text` (the level ring).
| arg | type | description |
|---|
| frac | number | |
| size | number | |
| text | string | |
| colour | string? | |
button(id: string, text: string, callback: string, on: boolean?, style: any?) → any
| arg | type | description |
|---|
| id | string | |
| text | string | |
| callback | string | |
| on | boolean? | |
| style | any? | |
enter(dy: number, delay: number?) → any
| arg | type | description |
|---|
| dy | number | |
| delay | number? | |
promptItem(key: string) → any
| arg | type | description |
|---|
| key | string | |
renderPrompt(force: boolean?) → void
| arg | type | description |
|---|
| force | boolean? | |
prompt(owner: string, key: string, verb: string, object: string?) → void
Offer the prompt: `key` is a control (alias such as "interact", or an .inputBinding path).
| arg | type | description |
|---|
| owner | string | |
| key | string | |
| verb | string | |
| object | string? | |
promptSide(side: string) → void
Where the prompt stands along the bottom: "center" (default) or "left", so a
panel on the right (the controls overlay on a narrow screen) never covers it.
| arg | type | description |
|---|
| side | string | |
unprompt(owner: string) → void
| arg | type | description |
|---|
| owner | string | |
currentControls( ) → void
The items the bar shows right now: the top context's, plus what others added to it.
isGameButton(item: any) → boolean
Whether a controls item is a button of the game being played (`game = true`, or a
console button's name) rather than an interaction with the room.
| arg | type | description |
|---|
| item | any | |
renderBar(force: boolean?) → void
| arg | type | description |
|---|
| force | boolean? | |
controls(owner: string, title: string, items: { any }, priority: number?) → void
Push (or replace) the controls bar for a context. `items` = `{ { label, bind } | { label, kbm, pad } }`.
`priority` (default 0) puts a modal overlay's bar (menu, shelf: 10) over the world's contexts.
| arg | type | description |
|---|
| owner | string | |
| title | string | |
| items | { any } | |
| priority | number? | |
setBarFolded(on: boolean) → void
Fold the world's controls bar down to its title and the Controls key (true), or show it in full.
| arg | type | description |
|---|
| on | boolean | |
barFolded( ) → boolean return S
uncontrols(owner: string) → void
| arg | type | description |
|---|
| owner | string | |
extend(context: string, owner: string, items: { any }?) → void
Add `items` from `owner` to the `context` bar while that context is on top (nil removes them).
| arg | type | description |
|---|
| context | string | |
| owner | string | |
| items | { any }? | |
toast(kicker: string, title: string, body: string?, colour: string?) → void
| arg | type | description |
|---|
| kicker | string | |
| title | string | |
| body | string? | |
| colour | string? | |
restoreNameLabels( ) → void
panel(owner: string, on: boolean) → void
Say that a full panel `owner` opened (`on`) or closed: while any is open,
other players' name labels are hidden on this peer (checked again each second,
so a player who joins meanwhile is hidden too).
| arg | type | description |
|---|
| owner | string | |
| on | boolean | |