yurembo Posted December 2, 2025 Posted December 2, 2025 How can I implement a function in C++ engine code and then call it from Lua code? And vice versa: call a Lua function from C++ code? Quote https://www.t2d-dev.ru/ https://yurembo.com/
Solution Josh Posted December 3, 2025 Solution Posted December 3, 2025 This will call a Lua function from C++: https://www.leadwerks.com/learn/CallFunction?lang=cpp This will get the engine's Lua sol state: https://www.leadwerks.com/learn/GetLuaState?lang=cpp&nolua=1 And this page has a lot of examples showing how to expose C++ classes and functions: https://www.leadwerks.com/learn/Scripting?lang=cpp Sol2 is a VERY deep dive, but it does everything I have wanted to do. Quote Let's build cool stuff and have fun.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.