Camera.setZoom()

   
Type function
Library wattageTileEngine.Camera.*
Return value VOID
Keywords Wattage, Layer, TileLayer, EntityLayer
See also  

Overview

This function sets the zoom of the camera. A zoom of one indicates no zoom.

NOTE: The zoom should be set before the first render and not changed afterwards. Dynamically changing the zoom may result in unwanted artifacts. This may be addressed in a future build.

Syntax

Camera.setZoom( zoom )
zoom (required)

Number. The zoom value to apply to the camera. A value of 1 indicates no zoom, values less than 1 but greater than 0 results in zooming out, and values greater than 1 results in zooming in.

NOTE: Values should be greater than 0.

Examples

-- tileEngineViewControl is an instance of ViewControl
local camera = tileEngineViewControl.getCamera()

-- zoom in to double size.
camera.setZoom(2.0)