api.view
ViewApi
The map view: where the viewport is looking, how far in, and what it draws over the terrain. A plugin that finds something needs this to show the user where it is.
Members
zoom
zoom(): number;
cursorTile
cursorTile(): { x: number; y: number; };
The tile under the pointer, as the status bar shows it.
setGridSize
setGridSize(size: 8 | 16 | 32 | 64 | 128): void;
Types
Declarations only this group names.
ViewFlagsinterface
interface ViewFlags
grid: boolean | |
|---|---|
locations: boolean | |
locationNames: boolean | |
units: boolean | |
sprites: boolean | |
doodads: boolean | Off draws the ground under the doodads (TILE) instead of the picture (MTXM). |
fog: boolean | |
elevation: boolean | Ground height per minitile, tinted (mid amber, high red). |
buildability: boolean | Unbuildable tile groups, hatched in blue. |
startLocations: boolean | |
animateWater: boolean | Cycle the palette so water and lava animate as they do in game. |
animateUnits: boolean | Run the units' iscript idle animations (turrets, pulsing buildings, fires, smoke). |
GoTotype
type GoTo = {
kind: "tile";
x: number;
y: number;
} | {
kind: "unit";
index: number;
} | {
kind: "sprite";
index: number;
} | {
kind: "location";
index: number;
};
Where view.goTo should take the user. Issues from query.validate carry one.