Camera

   
Type Camera
Library wattageTileEngine.*
Keywords Wattage, Camera, Tile Engine
See also  

Overview

A camera is used by the tile engine renderer to determine what is visible. In typical usage, the camera will be created by the ViewControl and not the developer.

Syntax

An instance of the camera can be retrieved from the ViewControl.

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

-- set camera location in tile coordinates (not pixels)
camera.setLocation(10.5, 10.5)

-- pass camera to the tile engine's render function
tileEngine.render(camera)

Constructor

new()

Functions

isLocationDirty()
setLocationDirty()
setLocation()
getX()
getY()
getLayer()
setLayer()
isLayerDirty()
setLayerDirty()
getZoom()
setZoom()
isZoomDirty()
setZoomDirty()

Properties

width
height
pixelWidth
pixelHeight