Krig Game Engine Lua Scripting API - Game (Engine)
More...
|
void | shutdown () |
|
float | get_fps () |
|
void | render_text (string, float, float) |
|
void | display_text (string, float, float, float, float, float) |
|
bool | test_key_pressed (int) |
|
bool | test_key_released (int) |
|
bool | test_special_key_pressed (int) |
|
bool | test_special_key_release (int) |
|
bool | test_debug_enabled () |
|
Vertex2 | get_mouse_coordinates () |
|
void | play_sound (GameObjectReference, string) |
|
GameObjectReference | get_camera () |
|
GameObjectReference | get_player () |
|
float | get_script_value (GameObjectReference, string) |
|
void | set_script_value (GameObjectReference, string, float) |
|
int | luaopen_krigEngine (lua_State *L) |
|
Krig Game Engine Lua Scripting API - Game (Engine)
Game (engine) API functionality.
◆ display_text()
void display_text |
( |
string |
, |
|
|
float |
, |
|
|
float |
, |
|
|
float |
, |
|
|
float |
, |
|
|
float |
|
|
) |
| |
Display 3D text to the screen.
- Parameters
-
string | text. |
float | x coordinate. |
float | y coordinate. |
float | z coordinate. |
float | scale x. |
float | scale y. |
- Returns
- n/a
◆ get_camera()
GameObjectReference get_camera |
( |
| ) |
|
Get a game object reference to the active camera object.
- Returns
- GameObjectReference
◆ get_fps()
Query the engine for the last calculated value of frames per second (FPS). Frames per second is calculated each iteration of the game loop.
- Returns
- float frames per second
◆ get_mouse_coordinates()
Vertex2 get_mouse_coordinates |
( |
| ) |
|
Query the engine to determine the mouse's last known coordinates.
- Returns
- Vertex2 - x, y coordinate of the mouse.
◆ get_player()
GameObjectReference get_player |
( |
| ) |
|
Get a game object reference to the player object.
- Returns
- GameObjectReference
◆ get_script_value()
float get_script_value |
( |
GameObjectReference |
, |
|
|
string |
|
|
) |
| |
Fetch variable value from specified game object's script.
- Parameters
-
- Returns
- string - variable name.
◆ play_sound()
void play_sound |
( |
GameObjectReference |
, |
|
|
string |
|
|
) |
| |
Play the sound in the specified wav file.
- Parameters
-
GameObjectReference | |
string | - path to wav file to play. |
- Returns
- n/a
◆ render_text()
void render_text |
( |
string |
, |
|
|
float |
, |
|
|
float |
|
|
) |
| |
Display 2D text to the screen.
- Parameters
-
string | text. |
float | x coordinate. |
float | y coordinate. |
- Returns
- n/a
◆ set_script_value()
void set_script_value |
( |
GameObjectReference |
, |
|
|
string |
, |
|
|
float |
|
|
) |
| |
Set variable value in specified game object's script.
- Parameters
-
GameObjectReference | |
float | value. |
- Returns
- string - variable name.
◆ shutdown()
Initiate the Game/Engine shutdown process. This command will kick off clean-up operations and will end with terminating the game.
- Returns
- n/a
◆ test_debug_enabled()
bool test_debug_enabled |
( |
| ) |
|
Query the engine for the state of the compiler's DEBUG flag.
- Returns
- bool
◆ test_key_pressed()
bool test_key_pressed |
( |
int |
| ) |
|
Query the engine to determine if the specified key has been pressed this game cycle.
- Parameters
-
int | - integer representation of the key |
- Returns
- bool
◆ test_key_released()
bool test_key_released |
( |
int |
| ) |
|
Query the engine to determine if the specified key has been released this game cycle.
- Parameters
-
int | - integer representation of the key |
- Returns
- bool
◆ test_special_key_pressed()
bool test_special_key_pressed |
( |
int |
| ) |
|
Query the engine to determine if the specified key has been pressed this game cycle.
- Parameters
-
int | - integer representation of the special key |
- Returns
- bool
◆ test_special_key_release()
bool test_special_key_release |
( |
int |
| ) |
|
Query the engine to determine if the specified key has been released this game cycle.
- Parameters
-
int | - integer representation of the special key |
- Returns
- bool