Skip to content

ClientFrame beta ​

Class of @v12-engine/client

ts
export declare class ClientFrame

The frame of the game: an ordered list of named phases, run one after the other each frame (client.frame). The client's own are CLIENT_PHASES; a game adds its own before or after one by name (add, or GameView.framePhases declared), for a pass of its own over the picture, or something to move before the camera does

Members ​

constructor ​

ts
constructor(phases: readonly FramePhase[], 
    times?: PhaseTimes | undefined);

Constructs a new instance of the ClientFrame class

add ​

ts
add(phase: FramePhase, place?: PhasePlace): () => void;

Adds a phase where place says (at the end when it says nothing), from the next frame on. Gives back what takes it out again. Throws when the phase it is placed by is not there, or one of its name already is

names ​

ts
get names(): string[];

The phases' names, in the order they run

now ​

ts
readonly now: FrameInfo;

The frame under way, or the last one: what the phases are given

phases ​

ts
get phases(): readonly FramePhase[];

The phases, in the order they run

run ​

ts
run(): boolean;

Runs the phases in order. Whether the frame ran to its end: false when a phase ended it