![]() |
naev 0.12.6
|
Bindings for Camera functionality from Lua. More...
#include "nlua_camera.h"#include "camera.h"#include "conf.h"#include "nlua_pilot.h"#include "nlua_vec2.h"#include "nluadef.h"#include "player.h"#include "spfx.h"
Go to the source code of this file.
Functions | |
| static int | camL_set (lua_State *L) |
| Lua bindings to interact with the Camera. | |
| static int | camL_pos (lua_State *L) |
| Gets the camera position. | |
| static int | camL_get (lua_State *L) |
| Gets the x/y position and zoom of the camera. | |
| static int | camL_setZoom (lua_State *L) |
| Sets the camera zoom. | |
| static int | camL_getZoom (lua_State *L) |
| Gets the camera zoom. | |
| static int | camL_shake (lua_State *L) |
| Makes the camera shake. | |
| int | nlua_loadCamera (nlua_env env) |
| Loads the camera library. | |
Variables | |
| static const luaL_Reg | cameraL_methods [] |
Bindings for Camera functionality from Lua.
Definition in file nlua_camera.c.
|
static |
Gets the x/y position and zoom of the camera.
Lua return parameter: number X position of the camera. Lua return parameter: number Y position of the camera. Lua return parameter: number Zoom level of the camera.
| L | Lua State |
Lua function: get
Definition at line 130 of file nlua_camera.c.
|
static |
Gets the camera zoom.
Lua return parameter: number Zoom level of the camera. Lua return parameter: number Maximum zoom level of the camera (furthest). Lua return parameter: number Minimum zoom level of the camera (closest).
| L | Lua State |
Lua function: get
Definition at line 201 of file nlua_camera.c.
|
static |
Gets the camera position.
Lua return parameter: Vec2 Position of the camera.
| L | Lua State |
Lua function: get
Definition at line 146 of file nlua_camera.c.
|
static |
Lua bindings to interact with the Camera.
An example would be:
Lua module: camera
Sets the camera.
Make sure to reset camera after using it or we'll run into trouble.
Lua usage parameter: camera.set() – Resets the camera to the pilot hard. Lua usage parameter: camera.set( a_pilot, true ) – Flies camera over to a_pilot. Lua usage parameter: camera.set( vec2.new() ) – Jumps camera to 0,0
Lua function parameter: Pilot|Vec2|nil target It will follow pilots around. If nil, it follows the player. Lua function parameter:[opt=false] boolean hard_over Indicates that the camera should instantly teleport instead of fly over. Lua function parameter:[opt=math.min(2000,distance)] speed Speed at which to fly over if hard_over is false.
| L | Lua State |
Lua function: set
Definition at line 81 of file nlua_camera.c.
|
static |
Sets the camera zoom.
Make sure to reset camera the zoom after using it or we'll run into trouble.
Lua usage parameter: camera.setZoom() – Resets the camera zoom
Lua function parameter: number zoom Level of zoom to use (1 would indicate 1 unit = 1 pixel while 2 would be 1 unit = 2 pixels) Lua function parameter:[opt=false] boolean hard_over Indicates that the camera should change the zoom gradually instead of instantly. Lua function parameter:[opt=naev.conf().zoom_speed] number speed Rate of change to use.
| L | Lua State |
Lua function: setZoom
Definition at line 171 of file nlua_camera.c.
|
static |
Makes the camera shake.
Lua usage parameter: camera.shake() – Shakes the camera with amplitude 1. Lua usage parameter: camera.shake( 0.5 ) – Shakes the camera with amplitude .5
Lua function parameter: number amplitude Amplitude of the shaking.
| L | Lua State |
Lua function: shake
Definition at line 218 of file nlua_camera.c.
| int nlua_loadCamera | ( | nlua_env | env | ) |
Loads the camera library.
| env | Lua environment. |
Definition at line 48 of file nlua_camera.c.
|
static |
Camera Lua methods.
Definition at line 33 of file nlua_camera.c.