Skip to content

five-on-it / apps/client/src/gui/panel

apps/client/src/gui/panel ​

A panel of the in-game UI drawn with Babylon's GUI: a container on the GUI layer's full-screen texture, holding the controls of a laid-out block tree (layout.ts) at the places the layout gave them: rectangles for boxes, a text block per line, key caps, buttons (lit under the pointer, greyed out), a numeric input, a map picture with its dots. A panel is rebuilt only when what it shows changed (its signature); a field's value and a map's dots change in place, so typing and a moving player never rebuild it. A panel taller than it may be scrolls with the wheel inside a clipped window. Its named blocks, where they are on the page, are what the end-to-end tests read and click.

A panel that takes the mouse answers the pointer itself (pointer), from the layout it shows now, not through the GUI's picking of its controls: a rebuild replaces every control, the GUI picks a control only once a frame has laid it out, and it forgets a press whose control went, so a click meeting a rebuild (a message arriving, a read receipt) was lost. A press is a down and an up of one pointer's left button on the same button, map or field, wherever the layout had it at each. PanelPointing hands each event to the topmost panel under it alone, and looks again at what lies under a still pointer when a panel changes (the lit button, the cursor).

Classes ​

Interfaces ​

Type Aliases ​