Skip to content

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

Class: GuiPanel ​

Defined in: apps/client/src/gui/panel.ts:153

A panel on the GUI layer.

Constructors ​

Constructor ​

new GuiPanel(host, name, rules): GuiPanel

Defined in: apps/client/src/gui/panel.ts:180

Parameters ​

host ​

PanelHost

name ​

string

rules ​

PanelRules

Returns ​

GuiPanel

Properties ​

name ​

readonly name: string

Defined in: apps/client/src/gui/panel.ts:177

Its name on the layer.


root ​

readonly root: Container

Defined in: apps/client/src/gui/panel.ts:155

Its container on the layer (hidden while it shows nothing).

Accessors ​

shown ​

Get Signature ​

get shown(): boolean

Defined in: apps/client/src/gui/panel.ts:200

Whether it shows anything.

Returns ​

boolean


size ​

Get Signature ​

get size(): object

Defined in: apps/client/src/gui/panel.ts:205

Its size as laid out (px; zero while hidden).

Returns ​

object

height ​

height: number

width ​

width: number

Methods ​

covers() ​

covers(x, y): boolean

Defined in: apps/client/src/gui/panel.ts:246

Whether a point of the page (px) is on it, and it takes the mouse there.

Parameters ​

x ​

number

y ​

number

Returns ​

boolean


cursorAt() ​

cursorAt(x, y): string

Defined in: apps/client/src/gui/panel.ts:297

The cursor the pointer wants at a point of the page over this panel ('' off what takes a click).

Parameters ​

x ​

number

y ​

number

Returns ​

string


hide() ​

hide(): void

Defined in: apps/client/src/gui/panel.ts:305

Hides it.

Returns ​

void


moveTo() ​

moveTo(left, top): void

Defined in: apps/client/src/gui/panel.ts:230

Moves it to a place (a label following something in the world).

Parameters ​

left ​

number

top ​

number

Returns ​

void


named() ​

named(): NamedRect[]

Defined in: apps/client/src/gui/panel.ts:256

Its named blocks where they are on the page (px): cut to the window of a panel that scrolls, those scrolled out of sight left out.

Returns ​

NamedRect[]


pointer() ​

pointer(event, over): void

Defined in: apps/client/src/gui/panel.ts:277

Answers a pointer event from the layout shown now (PanelPointing hands it every one: over when this panel is the topmost under it, else it happened elsewhere, and a press there takes a field's keys away). A press is a down and an up of one pointer's left button on the same button or map, wherever the layout had it at each: a rebuild between them, or just before the down, loses no click, nor does another button or finger.

Parameters ​

event ​

PanelPointer

over ​

boolean

Returns ​

void


replace() ​

replace(): void

Defined in: apps/client/src/gui/panel.ts:239

Lays it out again where its rules say (the window changed size, the strip under it grew).

Returns ​

void


show() ​

show(block, force?): void

Defined in: apps/client/src/gui/panel.ts:210

Shows a block tree (rebuilt only if it changed), or nothing.

Parameters ​

block ​

Block | undefined

force? ​

boolean = false

Returns ​

void