WorldPins beta
Class of @v12-engine/client
export declare class WorldPinsElements of the page pinned to the world: a label over a tower, a marker at a spot of the map. Each frame, the client puts them where their spot is on the screen, hides those that are out of the view or over what the player does not see, and takes out those whose entity is gone. They are in a layer of their own over the view and under the HUD, which lets the pointer through: an element that is to be clicked says so (pointer-events: auto)
Members
constructor
constructor(
layer: HTMLElement, state: GameState, terrain: Terrain,
heightOf: (id: number) => number, projectTo: ProjectTo,
seen?: (x: number, z: number) => boolean);Constructs a new instance of the WorldPins class
clear
clear(): void;Takes every pin out: the game is over
layer
readonly layer: HTMLElement;The layer they go into
pin
pin(element: HTMLElement, at: PinAt, options?: PinOptions): Pin;Pins an element to the world: it is put into the layer, and moved with its spot from the next frame on
size
get size(): number;How many are pinned
update
update(alpha: number, width: number, height: number): void;Puts every pin where its spot is in the view, at alpha between two ticks. The client calls it every frame