Angel 3.2
A 2D Game Prototyping Engine
Static Public Member Functions | List of all members
LuaScriptingModule Class Reference

(Internal) Handles all interactions with our Lua layer More...

#include <LuaModule.h>

Static Public Member Functions

static void Prep ()
static void Initialize ()
static void Finalize ()
static void ExecuteInScript (const String &code)
static lua_State * GetLuaState ()
static void DumpStack ()

Detailed Description

This internal class is the glue between the compiled Angel simulation engine and the scripting layer generated by SWIG.

The World class handles all interactions for setup and teardown; the only bit you should care about for your game code is the ExecuteInScript function.

For more information about Lua, visit

Definition at line 73 of file LuaModule.h.

Member Function Documentation

void LuaScriptingModule::Prep ( )

Does the very initial stages of setting up Lua so that it can be used to load the preferences files.

Called by the World during setup.

Definition at line 52 of file LuaModule.cpp.

void LuaScriptingModule::Initialize ( )

Work the magic to set up Lua and load our extension module.

Note that the start.lua file located in Scripting/EngineScripts will get executed when this function is called. It's copied to the Resources/Scripts directory of all games as they're built.

Called by the World during setup.

Definition at line 78 of file LuaModule.cpp.

void LuaScriptingModule::Finalize ( )

Closes down Lua. Called by the World when it's destroyed.

Definition at line 100 of file LuaModule.cpp.

void LuaScriptingModule::ExecuteInScript ( const String &  code)

Execute a string in the Lua interpreter. Can be dangerous, but can also make generating new interactions a lot easier. If you're using this function, just be careful about what you pass in.

codeThe code to execute.

Definition at line 110 of file LuaModule.cpp.

lua_State * LuaScriptingModule::GetLuaState ( )

Get the internal Lua state that all our script code is using to run.

The a pointer to the lua_State object at the heart of things.

Definition at line 155 of file LuaModule.cpp.

void LuaScriptingModule::DumpStack ( )

Print information about the current Lua stack to the system log. Useful for debugging any custom Lua integration.

Definition at line 160 of file LuaModule.cpp.

The documentation for this class was generated from the following files: