EditorPanelApis beta
Interface of @v12-engine/editor
export interface EditorPanelApisWhat each panel offers the others (panel.provide), by the panel's id: the editor's own, and a game's. A game adds its own by declaration merging, as EditorEvents, so editor.panels.api('td.waves') and panels.when('td.waves') know what the waves panel offers:
declare module '@v12-engine/editor' {
interface EditorPanelApis {
'td.waves': { pick(wave: number): void }
}
}The editor's own: the Effects panel (fx) shows an effect by its name (reveal); the Assets panel (assets) takes files in (take); the Cinematic panel (cinematic) opens a cinematic and does its actions
Members
animation
animation: {
open(what: {
type?: string;
src?: string;
clip?: string;
apply?: string;
}): Promise<void>;
run(action: string, clicked?: boolean): boolean;
};The Animation panel: a model's clips as keys on its timeline, previewed on its stage
assets
assets: {
take(files: FileList | readonly File[]): Promise<void>;
};The Assets panel: files taken in as if dropped on it, where it is set to put them; one alone is picked after
cinematic
cinematic: {
open(id: string, at?: number): Promise<void>;
run(action: string, clicked?: boolean): boolean;
readonly preview: CinematicPreview;
playInGame(): void;
};The Cinematic panel's API: opens a cinematic by id at a time, runs a panel action, and gives the preview
floats
floats: {
reveal(kind: string): void;
};The Words panel: a kind of floating words shown, by its name (damage, a game event's id)
fx
fx: {
reveal(name: string): void;
};The Effects panel's API: reveal(name) shows an effect of the game by its name
unitHud
unitHud: {
reveal(type: string): void;
};The Unit HUD panel: a unit type's HUD shown, by its id (* for the default of every unit)