LHCamera Reference

LHCamera.lua

Overview

LHCamera class is used to load a camera object from a level file.

Conforms to:

LHNodeProtocol

LHAnimationsProtocol

Instance Methods

getFollowedNode

local  getFollowedNode()
Discussion

Get the node that this camera follows. The node or nil.

Declared In
LHCamera.lua

getImportantAreaUnit

local  getImportantAreaUnit()
Discussion

Returns the camera important area unit. A table like {x = 0.2, y=0.3}

Declared In
LHCamera.lua

getLockX

local  getLockX()
Discussion

Returns the camera x axis movement locking state. A boolean value.

Declared In
LHCamera.lua

getLockY

local  getLockY()
Discussion

Returns the camera y axis movement locking state. A boolean value.

Declared In
LHCamera.lua

getOffsetUnit

local  getOffsetUnit()
Discussion

Returns the camera unit offset. A table like {x = 0.2, y=0.3}

Declared In
LHCamera.lua

getPosition

local  getPosition()
Discussion

Get the camera position. A table like {x = 100, y=200}

Declared In
LHCamera.lua

getRestrictedToGameWorld

local  getRestrictedToGameWorld()
Discussion

Get a boolean value if this camera is restricted to the game world area.

Declared In
LHCamera.lua

getSmoothMovement

local  getSmoothMovement()
Discussion

Returns if the camera is trying to reach the important area smoothly.

Declared In
LHCamera.lua

isActive

local  isActive()
Discussion

Returns wheter or not the camera is the active camera in the scene. A boolean value.

Declared In
LHCamera.lua

setActive

local  setActive(value)
Parameters
value

A boolean value.

Discussion

Sets the camera active or inactive.

Declared In
LHCamera.lua

setFollowedNode

local  setFollowedNode(node)
Parameters
node

A LevelHelper node object

Discussion

Sets the node this camera should follow.

Declared In
LHCamera.lua

setImportantAreaUnit

local  setImportantAreaUnit(unit)
Parameters
unit

The new camera important area unit. This value is multipled with the screen dimensions. A table value {x = 0.4, y = 0.2}

Discussion

Set the important camera view unit. This value is multipled with the screen dimensions. The area is based on the center. Based on this area the camera position will be calculated based on the following node movement. This value is ignored when camera is not following a node.

Declared In
LHCamera.lua

setLockX

local  setLockX(value)
Parameters
value

A boolean value specifying if camera should move on x axis.

Discussion

Set whether or not the camera should move on x axis. This value is ignored when camera is not following a node.

Declared In
LHCamera.lua

setLockY

local  setLockY(value)
Parameters
value

A boolean value specifying if camera should move on y axis.

Discussion

Set whether or not the camera should move on y axis. This value is ignored when camera is not following a node.

Declared In
LHCamera.lua

setOffsetUnit

local  setOffsetUnit(unit)
Parameters
unit

The new camera offset unit. This value is multipled with the screen dimensions and added to the camera position. A table value {x = 0.4, y = 0.2}

Discussion

Set the camera view offset unit. This value is added to the camera position as an offset.

Declared In
LHCamera.lua

setPosition

local  setPosition(position)
Parameters
position

The new camera position. A table like {x = 100, y=200}

Discussion

Set the camera position. The center of the view if the camera is active.

Declared In
LHCamera.lua

setRestrictedToGameWorld

local  setRestrictedToGameWorld(value)
Parameters
value

A boolean value

Discussion

Sets whether this camera should be restricted to the game world area.

Declared In
LHCamera.lua

setSmoothMovement

local  setSmoothMovement(value)
Parameters
value

A boolean value specifying if camera should reach its important area smoothly.

Discussion

When an important area is set, and the following node has exist it or has changed direction, smooth movement will make the camera reach its new position in a non-snapping mode. This value is ignored when camera is not following a node.

Declared In
LHCamera.lua
Last updated: 2015-3-15

Back to top

Copyright © VLADU BOGDAN DANIEL PFA.