Jump to content

Recommended Posts

Posted

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~

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!

  • 2 weeks later...
Posted

Does anyone have any idea?

(Bump)

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!

Posted

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.

Posted

can you provide a link with more details about "tolua++"

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!

Posted

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.

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++

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...