Skip to content

1681-engine / index / zoomSteps

Function: zoomSteps() ​

ts
function zoomSteps(
   canvasHeight, 
   offsets?, 
   lowest?, 
   options?
): object[];

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

The zoom steps to offer a player on a screen this tall, by zoom from farthest to nearest: each of offsets and, where it lies below the screen's own zoom and no further than lowest, the offset that lands on halfZoom. Two offsets giving the same zoom are offered once, the one nearer 0 kept.

Parameters ​

ParameterTypeDefault value
canvasHeightnumberundefined
offsetsreadonly number[]...
lowestnumber-2.5
options?PixelZoomOptionsundefined

Returns ​

object[]

Released under the MIT License.