xtreampb Posted December 23, 2012 Share Posted December 23, 2012 I want to create a lua script but expose the functions of this script to my C++ game. I am making the UI in lua and want to do something like this KeyHit(KEY_P) { //do lua function calls //int result=luaUIBtnPress(); } I would also like to send what button was pressed in my lua UI back to my C++ function, as shown above. Can anyone guide me on how i can do this or a better way to do this. Or should I just use wxWidgets or another UI library? Thanks ~Xtreampb~ Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post! Link to comment Share on other sites More sharing options...
xtreampb Posted December 31, 2012 Author Share Posted December 31, 2012 Does anyone have any idea? (Bump) Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post! Link to comment Share on other sites More sharing options...
ChrisMAN Posted December 31, 2012 Share Posted December 31, 2012 I have wanted to do the same but from what i saw only a small portion of the lua bindings are exposed in the engine. It would be very helpful for leadwerks to expose its internal c++ lua binding library and the native c one that ships with lua. Quote Link to comment Share on other sites More sharing options...
Admin Posted December 31, 2012 Share Posted December 31, 2012 I recommend tolua++ for this. Quote Link to comment Share on other sites More sharing options...
ChrisMAN Posted December 31, 2012 Share Posted December 31, 2012 I am a compiling newb how do you compile against the leadwerks built in lua? Quote Link to comment Share on other sites More sharing options...
xtreampb Posted December 31, 2012 Author Share Posted December 31, 2012 can you provide a link with more details about "tolua++" Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post! Link to comment Share on other sites More sharing options...
Josh Posted December 31, 2012 Share Posted December 31, 2012 http://www.codenix.com/~tolua/ Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Pixel Perfect Posted December 31, 2012 Share Posted December 31, 2012 I simply added LuaJit to the build so I could make calls to pop and push values off and onto the stack and effectively move data between Lua and my framework. As Josh doesn't expose any of those functions I had no choice but do that. Using a binding library like tolua++ or LuaBind will give you a real access to your C++ classes if that's what you really need. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
ChrisMAN Posted December 31, 2012 Share Posted December 31, 2012 Is there a way to add lua.h against the engine.dll? Quote Link to comment Share on other sites More sharing options...
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.