scmJS docs

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;

setZoom

setZoom(zoom: number): void;

0.25 … 8, as the zoom control's steps.

visible

visible(): Rect;

The tiles on screen.

center

center(x: number, y: number): void;

Scroll so a tile is in the middle of the viewport.

goTo

goTo(target: GoTo): void;

Scroll to an object (and select it, for a unit, sprite or location).

cursorTile

cursorTile(): { x: number; y: number; };

The tile under the pointer, as the status bar shows it.

flags

flags(): ViewFlags;

The View menu's ticks: grid, locations, units, sprites, doodads, fog, …

setFlags

setFlags(patch: Partial<ViewFlags>): void;

gridSize

gridSize(): number;

Grid spacing in map pixels (32 = one tile).

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.

Seen in

scmJS 0.1.0 · Generated from the repository. StarCraft and Brood War are trademarks of Blizzard Entertainment; this project ships none of their data.