Skip to content

OpenEditorOptions ​

Interface of @v12-engine/editor

ts
export interface OpenEditorOptions extends EditorSetup, Pick<EditorAppProps, 'map' | 'leave' | 'id'>, RuntimeOptions

What a game's map editor is opened with, on a page

Members ​

game ​

ts
game: Game<unknown> | LoadedGame;

The game whose maps it makes (createGame): its rules, its view (fetched as the editor opens) and its start, which Play here runs where onStart is left out. Or one loaded already (LoadedGame)

onLoaded ​

ts
onLoaded?: (editor: PanelClient) => void;

Told the editor once it is there, to drive it from code (editor.dock, editor.dropAt, ...)

onStart ​

ts
onStart?: GameSource['onStart'];

What the game does once the world of a map being tried is made (Play here), before anyone plays: computer players, a mission given, the first wave sent. As launch's onStart; the game's (Game.onStart) when left out

playHere ​

ts
playHere?: EditorAppProps['playHere'] | false;

Plays the map being edited another way than launch would: makes the game's client itself. false for an editor that only makes maps

project ​

ts
project?: boolean;

Whether maps are kept in the files of a project (a dev server with the editorFiles plugin) or in the browser. Asked of the dev server when left out

target ​

ts
target: HTMLElement | string;

Where on the page the editor goes: an element, or a selector of one. The editor fills it, so it has a size of its own