Skip to content

PingWheel beta ​

Class of @v12-engine/client

ts
export declare class PingWheel

The ping wheel's controller (client.pingWheel): opened at a spot, aimed, sent or put away. Its state is a signal the drawings follow; it works with no pointer too (aimAt an angle: the keys)

Members ​

constructor ​

ts
constructor(pings: PlayerPings, look?: PingWheelLook);

Constructs a new instance of the PingWheel class

aim ​

ts
aim(pointer: {
        x: number;
        y: number;
    }): void;

The pointer at a spot of the view: the item it is toward picked, none within the dead zone

aimAt ​

ts
aimAt(angle: number): void;

An item picked by an angle (radians, as PingWheelItem.angle), as the keys do: the nearest

cancel ​

ts
cancel(): void;

Puts it away, nothing sent

look ​

ts
look: PingWheelLook;

How it looks and works (GameView.pings.wheel), changed in place while the game runs

open ​

ts
get open(): boolean;

Whether it is open

release ​

ts
release(): string | undefined;

Lets go: the picked kind sent at the spot (or the first one, for a release in the middle, as the look says), and the wheel closed. The kind sent, or nothing

show ​

ts
show(at: {
        x: number;
        y: number;
    }, ground: Vec2): boolean;

Opens it at a spot of the view, over a spot of the map. Not where there is nothing to ping with

state ​

ts
readonly state: Accessor<PingWheelState | null>;

The wheel as it is now, or null while it is closed. A signal

turn ​

ts
turn(step: 1 | -1): void;

The next item round (or back, step -1) from the one picked: the keys' way round the wheel