1681-engine / ui / DomWorldAnchors
Class: DomWorldAnchors ​
Defined in: src/ui/dom/DomWorldAnchors.ts:44
DOM elements that follow points in the world (names over heads, speech bubbles, markers): placed every frame through the world layer's own transform, on whole CSS pixels, and hidden off screen. A style is written only when the rounded position or visibility changed, so a still crowd costs no DOM writes.
Constructors ​
Constructor ​
new DomWorldAnchors(overlay, layer): DomWorldAnchors;Defined in: src/ui/dom/DomWorldAnchors.ts:49
Parameters ​
| Parameter | Type | Description |
|---|---|---|
overlay | DomOverlay | - |
layer | LayerTransform | The layer the points are in: engine.stage.world. |
Returns ​
DomWorldAnchors
Methods ​
add() ​
add(
el,
target,
options?
): () => void;Defined in: src/ui/dom/DomWorldAnchors.ts:56
Places el (put inside the overlay's content if it is not already there) on target. Returns the remover.
Parameters ​
| Parameter | Type |
|---|---|
el | HTMLElement |
target | WorldPoint |
options | WorldAnchorOptions |
Returns ​
() => void
attach() ​
attach(ticker): () => void;Defined in: src/ui/dom/DomWorldAnchors.ts:87
Runs update on ticker after Pixi renders (UTILITY priority), so it reads the camera as this frame drew it, shake included. The returned function stops it.
Parameters ​
| Parameter | Type |
|---|---|
ticker | Ticker |
Returns ​
() => void
destroy() ​
destroy(): void;Defined in: src/ui/dom/DomWorldAnchors.ts:121
Returns ​
void
detach() ​
detach(): void;Defined in: src/ui/dom/DomWorldAnchors.ts:94
Returns ​
void
remove() ​
remove(el): void;Defined in: src/ui/dom/DomWorldAnchors.ts:78
Parameters ​
| Parameter | Type |
|---|---|
el | HTMLElement |
Returns ​
void
update() ​
update(): void;Defined in: src/ui/dom/DomWorldAnchors.ts:100
Places every element for this frame.
Returns ​
void