LunaLua global API functions
Jump to navigation
Jump to search
This is the new softcoded API system for custom written APIs. It provides functions to easy load APIs and functions for APIs to hook into events.
| Global API Functions | ||
|---|---|---|
| Function | Return values | Description |
| loadAPI(string packagename) | nil | Loads the api packagename.lua. Do load it outside every other function! (Recommended at the top of your scriptfile). If you have you own directory, the please expand package.path. |
| registerEvent(string apiName, string event, [string eventHandler], [boolean beforeMainCall]) | nil | Register events in the event loop. apiName is the package name of the api. event is the name of the event to be hooked in. If your event-function has a own name then you can set eventHandler (This is optional). If beforeMainCall set to false then this event will be called after the main function call. If set to true or this parameter is not passed then the function is called before the main call. |