Skip to content

PinOptions beta ​

Interface of @v12-engine/client

ts
export interface PinOptions

How to pin an element: where on it the spot is, what to do on removal, how far to move it, and when it is hidden

Members ​

anchor ​

ts
anchor?: 'above' | 'center' | 'below';

Which part of the element is at the spot: its bottom middle (above, the way a label sits over a unit), its middle, or its top middle (below). above when left out

hideWhenUnseen ​

ts
hideWhenUnseen?: boolean;

Whether it is hidden while its spot is in the fog, where the player sees nothing of it. A pin over an entity is hidden over what is not in sight anyway; this is for one at a spot of the map. No when left out

offset ​

ts
offset?: {
        x?: number;
        y?: number;
    };

Pixels to move it from its spot on the screen, right and down: a label's own margin, a marker's tip

onRemoved ​

ts
onRemoved?: () => void;

Told when the pin is taken away for its entity being gone, after the element is taken out