Skip to content

1681-engine / index / worldZoom

Function: worldZoom() ​

ts
function worldZoom(
   canvasHeight, 
   offset?, 
   options?
): number;

Defined in: src/core/pixelZoom.ts:41

The camera zoom (screen px per world px) for a canvas this tall, moved offset steps by the player (rounded to half steps), within min–max. Whole, or exactly halfZoom: a half step anywhere else rounds to the whole one.

Parameters ​

ParameterTypeDefault value
canvasHeightnumberundefined
offsetnumber0
options?PixelZoomOptionsundefined

Returns ​

number

Released under the MIT License.