Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storing references to loaded Lua table for callback logic. #182

Open
dkushner opened this issue Dec 13, 2017 · 0 comments
Open

Storing references to loaded Lua table for callback logic. #182

dkushner opened this issue Dec 13, 2017 · 0 comments

Comments

@dkushner
Copy link

Hey all! Currently trying to integrate Lua into my application as a scripting extension for rapid development. I wish to allow the user to implement custom components with something like the following structure:

local Test = { }

function Test:Init() end

function Test:Update(delta) end

function Test:Destroy() end

return Test

If I have a Lua instance stored in a struct, how might I also store within this struct, references to the callbacks defined in that loaded script? For instance, I want to load this table on initialization to get references to each of the callbacks and then be able to call the user-defined Test:Update(delta) function each frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant