Introduction and table of contents - The init file - The Main object - Importing new textures - Importing 3D meshes - New data types - List of instantiable objects - List of static objects
The Loving Cube Engine scripting is using the lua programming language. It's advised to have some little knowledge of Lua to modify the application (but this is not the most complex language ever, so you may also learn on-the-job by looking at the existing scripts).
To modify the script, open the file "data/main.lua" (or another name, depending of the value of lua_file_path in The init file) with a text editor like notepad or Notepad++.
Methods in Lua must be called like this:
myobjectinstance:methodName()
except for static methods which are shown in grey and must be called like this:
MyObject.methodName()
Most of the time this is a static constructor, which is called like this: local myobjectinstance = MyObject.new()
, or a singleton, and the instance is then retrieved with local cubes_engine = CubesEngine.get()
Each instancied object should be eventually destroyed with myobjectinstance:drop(), before exiting the program; the Lua garbage collector will not do it for you (TODO dev).
Sprite Button CountBar Model3D Sphere3D Cuboid3D Sound Ocean BufferOfCubesAndActiveObjects EditText CubesEngineThese objects have only static methods so these latter must be called like this: MyObject.methodName()
In the following document: