EditorScreen beta
Class of @v12-engine/editor
export declare class EditorScreenThe scene the map is drawn in, as the editor shows it: what is under a point of the view, what a tool shows over the map while it works (a box, a brush, a ghost, a draft), what is done each frame, the pictures of models and scatter, the map's sounds and its hour.
A part of the editor, as it gives it (editor.screen)
Members
constructor
constructor(host: ScreenHost);Constructs a new instance of the EditorScreen class
drawPass
drawPass(pass: PicturePass, on: boolean): void;A pass of the game's own drawn in the editor's view, or not (passes): the picture seen without it, and with it again
foliage
readonly foliage: EditorFoliagePreview;What the Grass and bushes fold shows of a look for a moment (EditorFoliagePreview): a walker crossing a patch, a fire, a patch ruined and growing back, a gust, the levels from afar. The view's alone: never the map's, never saved
groundAt
groundAt(x: number, y: number): Vec2 | null;The ground under a point of the view, none off the map
hear
hear(on: boolean): void;Hears the sounds of the map and its music while editing, from where the camera looks, or stops
hearing
get hearing(): boolean;Whether the sounds of the map are heard while editing
modelInfo
modelInfo(src: string): Promise<ModelInfo>;What there is in a model of the game's folder or the shared one: triangles, bones, animations
modelPreview
modelPreview(src: string): Promise<string>;A picture of a model of the game's folder or the shared one, by its path in models/, as a data URL
onFrame
onFrame(run: (dt: number) => void): () => void;Something to do before each frame the editor draws, with the seconds since the last: for code of a game's own outside a panel (a panel's is panel.frame, which goes with the panel). One that throws is taken out and said in the Console, and the editor draws on. Gives back what stops it
passes
get passes(): readonly PicturePass[];The game's own passes over the picture (GameView.world.passes), as the editor's view draws them: each drawn once its shader is ready, and turned off here (enabled) to see the picture without it
pickAt
pickAt(x: number, y: number, options?: {
through?: boolean;
}): Named | null;What is under a point of the view: an object, a camp, or a region (by its outline or its name), a point or a path
pickFromScene
pickFromScene(options: MapPickOptions): () => void;Asks for the next click in the scene (or every one, many): it goes to pick with the ground under it, its cell and what stands there (MapPick), not to the picked tool; the pointer is told of meanwhile (hover); Escape stops asking (cancelled), as does another request. The status line says hint while it asks, and the pointer is a target. A panel's own is panel.pick, which stops with the panel. Gives back what stops asking
placing
placing(objects: readonly number[], camps?: readonly number[]): void;The things and camps a drag moves by hand: they stand as they go, not walk. None when it is over
scatterPreview
scatterPreview(look: string): Promise<string>;A picture of a kind of what is scattered, as a data URL
selectIn
selectIn(area: ScreenRect | readonly {
x: number;
y: number;
}[]): ByCollection<number[]>;What is drawn inside a box on the screen, or a lasso (its corners in order), and can be picked, by kind (for the selection to take: add, replace)
showBox
showBox(box: ScreenRect | null): void;Draws the box a selection is dragged out with, or takes it away with null
showBrush
showBrush(point: Vec2 | null, radius: number, shape?: 'round' | 'square'): void;Shows the circle a brush covers, or takes it away with null
showGhost
showGhost(type: string | null, ground?: Vec2, fits?: boolean): void;Shows what is about to be put down where it would go, red when it does not fit. Null takes it away
showHour
showHour(hour: number): void;Shows the map at an hour of the day, to see it by night. The editor's, not the map's: see MapEditor.setDay
showLasso
showLasso(corners: readonly {
x: number;
y: number;
}[] | null): void;Draws the lasso a selection is drawn with (its corners in order, closed), or takes it away with null
shownZone
get shownZone(): number | undefined;The zone of the picture shown whole wherever the camera looks, by its id (showZone)
showPrefabDraft
showPrefabDraft(parts: {
shape: AreaShape;
fits: boolean;
}[] | null): void;A prefab about to be put down, drawn on the ground: each part's footprint, red where it does not fit
showPrefabModels
showPrefabModels(parts: readonly PrefabModel[] | null): void;The models of a prefab about to be put down, see-through where each would stand. Null takes them away
showRegionDraft
showRegionDraft(shape: AreaShape | null): void;Shows a region being marked out, before it is one. Null takes it away
showWind
showWind(wind: MapWind | undefined): void;Shows the map in a wind, to judge how its grass and bushes sway (the Grass and bushes fold's preview wind): the editor's, never saved, nor the wind of a game played here. None for the map's own wind again
showZone
showZone(id: number | undefined): void;Shows a zone of the picture (MapPictureZone) whole wherever the camera looks: its look, mist and light, to set it without going there. None (undefined) for each as much as the camera looks into it, as in the game
windShown
get windShown(): MapWind | undefined;The wind the map is shown in where it is not the map's own (showWind)