Module model.object.object_bridge
ObjectBridge module.
Functions
ObjectBridge.Register (name, objectBridge) | Register new bridge. |
ObjectBridge.GetObjectBridges () | Get a associative array of name->objectBridge for all objectBridges. |
ObjectBridge.GetObjectBridge (name) | Get a specific objectBridge |
Tables
ObjectBridge | ObjectBridge class. |
Functions
- ObjectBridge.Register (name, objectBridge)
-
Register new bridge.
Parameters:
- name string Name of the bridge.
- objectBridge ObjectBridge Instance of a class implementing the ObjectBridge interface.
- ObjectBridge.GetObjectBridges ()
-
Get a associative array of name->objectBridge for all objectBridges.
Returns:
-
table.
- ObjectBridge.GetObjectBridge (name)
-
Get a specific objectBridge
Parameters:
- name string Name of the ObjectBridge.
Returns:
-
ObjectBridge.
Tables
- ObjectBridge
-
ObjectBridge class. Use to represent objects in the game world.
It can use the s11n API to provide serialization support. Consult https://github.com/gajop/s11n for details.
Fields:
- humanName string Human readable name.
- NoHorizontalDrag bool If true, disables horizontal drag
- ValidObject function Function accepting objectID number. Returns true if objectID is valid.
- OnSelect function Function accepting objectIDs table, invoked when selected.
- DrawObject function Function invoked when drawing objects manually. Accepts objectID number and obj table as params.
- OnDoubleClick function Function invoked when double clicked on an object in the game world.
- OnClick function Function invoked when clicked on an object in the game world. Accepts objectID, x, y and z as parameters.
- GetObjectAt function Function that returns an object at location x, z (if any exists).
- OnLuaUIAdded function Function invoked when LuaUI gets notification that an object was added. Accepts (objectID, object).
- OnLuaUIRemoved function Function invoked when LuaUI gets notification that an object was removed. Accepts (objectID).
- OnLuaUIUpdated function Function invoked when LuaUI gets notification that an object was updated. Accepts (objectID, name, value).