Skip to content

RtsCameraOptions beta ​

Interface of @v12-engine/client

ts
export interface RtsCameraOptions

Settings for an RTS camera: its angle, how near and far it goes, its speed and its edges

Members ​

bounds ​

ts
bounds?: CameraBounds;

Where the player may look, in world units: a part of the map. The whole map when left out

distance ​

ts
distance?: number;

The distance the view starts at, in cells: 32 when left out, kept between the nearest and the farthest

edgeSize ​

ts
edgeSize?: number;

Pixels from the screen edge where the view starts to scroll

maxDistance ​

ts
maxDistance?: number;

How far the view goes, in cells: 48 when left out. RtsCamera.setLimits changes both while the game runs

minDistance ​

ts
minDistance?: number;

How close the view comes, in cells: 12 when left out

overviewFrom ​

ts
overviewFrom?: number;

Past this distance the view looks at the map rather than from in it, as an editor's does: the map's mist and what is left out by distance (DetailLook.cull, a level's draw: 'none') move away by as much as the view is farther than this, so they look from up there as they do from here. A game's camera stays in its look when left out

pitch ​

ts
pitch?: number;

Degrees between the view direction and the ground, the same at every zoom: 56 when left out. A game's view with neither this nor pitchCurve tilts as it zooms, as the examples' do (zoomPitch)

pitchCurve ​

ts
pitchCurve?: (distance: number) => number;

How steep the view is at a distance, in degrees, instead of pitch: closer is flatter, as in Warcraft III ((distance) => 40 + distance * 0.4). While there is one it has the say over tilt and topDown

turn ​

ts
turn?: boolean;

Whether the player may turn the view (Q and E, where the keys are as they come). Yes when left out

yaw ​

ts
yaw?: number;

Degrees the view rests turned by, and swings back to once the keys that turn it are let go of: 0 looks north

zoomSpeed ​

ts
zoomSpeed?: number;

How fast the wheel zooms, times the usual: 1 when left out

zoomToPointer ​

ts
zoomToPointer?: boolean;

Whether the wheel zooms about what is under the pointer, which stays there, rather than about the middle of the view. No when left out