LuaManual Overview - Gambini/libRocket GitHub Wiki


RocketLua can be used in an application that extends or embeds Lua. The only limitation is that your application initializes Rocket with the necessary System and Render interfaces, but these can easily be done from a custom Lua module.

RocketLua is made to be synonymous with the Python API with as little derivation as possible. Due to Lua not having a class system, it is impossible to have the Lua and Python APIs be 100% interchangeable, but it will not be difficult to see the same problem solved in one language and apply it to the other.

For a full list of accessible classes and methods please see the libRocket Lua API Reference.


RocketLua requires the Lua binaries and source. It was only tested with Lua 5.1, and there are no guarantees that any other versions will work.

Getting Started

Build the Rocket and RocketLua libraries and link them whichever way your compiler requires. Compiler build files are generated by CMake.

To start using RocketLua in your own project, you must first start Rocket's Lua interpreter (Rocket::Core::Lua::Interpreter) by calling Interpreter::Initialise(). And, if you are using RocketLuaControls as well, then you will have to initialize that by calling Rocket::Controls::Lua::RegisterTypes(). If you are using any scripts in non-rml files, you will have to call Interpreter::LoadFile() on them.

The best place to start exploring RocketLua is to look at the LuaInvaders sample application which is a rework of the standard Invaders sample but with Lua support. There is also a step by step tutorial describing the steps taken to do the conversion.