Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danengelbrecht/luascriptinstance
Library to expose access for getting and setting the current script instance
https://github.com/danengelbrecht/luascriptinstance
defold defold-library
Last synced: about 1 month ago
JSON representation
Library to expose access for getting and setting the current script instance
- Host: GitHub
- URL: https://github.com/danengelbrecht/luascriptinstance
- Owner: DanEngelbrecht
- License: mit
- Created: 2019-03-29T09:18:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-04T19:23:51.000Z (12 months ago)
- Last Synced: 2024-10-06T04:05:54.402Z (3 months ago)
- Topics: defold, defold-library
- Language: C++
- Size: 5.86 KB
- Stars: 9
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LuaScriptInstance
Library to expose access for getting and setting the current script instance.
# Installation
You can use LuaScriptInstance in your own project by adding this project as a [Defold library dependency](http://www.defold.com/manuals/libraries/). Open your game.project file and in the dependencies field under project add:https://github.com/DanEngelbrecht/LuaScriptInstance/archive/master.zip
Or point to the ZIP file of a [specific release](https://github.com/DanEngelbrecht/LuaScriptInstance/releases).
# Usage
Once the dependecy is added two Lua functions are available:
`lua_script_instance.Get()` and `lua_script_instance.Set(instance)`# LuaScriptInstance API
### lua_script_instance.Get()
Gets the current script instance. The returned value is an opaque type and you should only use it to set the current instance.**RETURN**
* ```instance``` (opaque) - the current script instance### lua_script_instance.Set(instance)
Sets the current script instance. The instance parameters must be a value returned by lua_script_instance.Get().**PARAMETERS**
* ```instance``` (opaque) - the script instance to set