Lua bindings to interact with the Camera.
An example would be:
|set (target[, soft_over=false[, speed=2500]])||Sets the camera.|
|get ()||Gets the camera position.|
|setZoom (zoom[, hard_over=false])||Sets the camera zoom.|
|get ()||Gets the camera zoom.|
|shake (amplitude:)||Makes the camera shake.|
- set (target[, soft_over=false[, speed=2500]])
Sets the camera.
Make sure to reset camera after using it or we'll run into trouble.
- target Pilot, Vec2 or nil It will follow pilots around. If nil, it follows the player.
- soft_over boolean Indicates that the camera should fly over rather than instantly teleport. (default false)
- speed Speed at which to fly over if soft_over is true. (default 2500)
camera.set() -- Resets the camera to the pilot hard.
camera.set( a_pilot, true ) -- Flies camera over to a_pilot.
camera.set( vec2.new() ) -- Jumps camera to 0,0
- get ()
Gets the camera position.
Position of the camera.
- setZoom (zoom[, hard_over=false])
Sets the camera zoom.
Make sure to reset camera the zoom after using it or we'll run into trouble.
- zoom number Level of zoom to use (1 would indicate 1 unit = 1 pixel while 2 would be 1 unit = 2 pixels)
- hard_over boolean Indicates that the camera should change the zoom gradually instead of instantly. (default false)
camera.setZoom() -- Resets the camera zoom
- get ()
Gets the camera zoom.
- number Zoom level of the camera.
- number Maximum zoom level of the camera (furthest).
- number Minimum zoom level of the camera (closest).
- shake (amplitude:)
Makes the camera shake.
- amplitude: float amplitude of the shaking
camera.shake() -- Shakes the camera with amplitude 1.
camera.shake( .5 ) -- Shakes the camera with amplitude .5