Connecting to GUI Objects

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • The second time I didn't build it but just used the headers that you guys included in the 3rdParty.zip. The first time I tried to build from the LuaPlus Repo

      *edit*
      to clarify the first link I posted was trying to build from the Git repo, the second link was me adding the header and lib directory's into my project's search directory's. And including <LuaState.h> and linking to the appropriate .lib
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz

      The post was edited 1 time, last by mholley519 ().

    • As soon as you tried to build LuaPlus, you changed the landscape of the file system. That's why I said to start over and follow the readme. Building LuaPlus isn't part of the readme. ;)

      Delete everything, synch up, and follow the instructions exactly. This is extremely important. The errors you're getting look like they're due to incorrect setup.

      For example, here's one of your errors:
      e:\dev\luaplusoriginal\src\luaplus\luastate.inl(33): error C2027: use of undefined type 'LuaPlus::LuaStackObject' e:\dev\luaplusoriginal\src\luaplus\luaplusinternal.h(55) : see declaration of 'LuaPlus::LuaStackObject'

      luaplusoriginal is not a directory you should be using because we don't reference it anywhere. We're not looking there. You can't move stuff around or try to build LuaPlus (there's actually a bug on that in our database). Make sure everything extracts to the appropriate place.

      The readme file tells you exactly what your directories should look like. Following the instructions there is critical.

      -Rez
    • I did it exactly as the readme said, and it is comes up with the same errors. Is it possible I am not setting my include directory properly? I have set

      E:\Dev\GCC\Source\GCC4\3rdParty\luaplus51-all\Src\
      where E:\Dev\GCC\ is simply where I extracted the
      3rdParty_v4.0.zip.
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • Well I gave up and wen't with LuaBind. It was relatively easy to set up. Thanks for the help though Rez, however hopeless I am lol
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • No worries. I'm not sure what to say, the errors you were getting were clearly pointing to a folder we don't create so my guess is that when you tried to build LuaPlus, you somehow changed your global property files to point to that.

      Luabind is perfectly fine. I went with LuaPlus because I found it a bit easier to deal with and didn't want to have dependencies on boost. They are very similar architecturally.

      -Rez
    • The way I was just about to do it, was using an XML/LUA hybrid, where I use XML for the initial positioning and layout. It's actually quite nice as I have it done that each element is relative to it's parent element. Then I have an ID attribute which will be used to bind the new GUI Object to Lua. Then as Rez showed before I now have a Command Attribute which will hold a Lua Script to be run on device input

      I know its not strictly Lua but it's another Idea for you
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz

      The post was edited 1 time, last by mholley519 ().

    • I use Lua for my GUI data. Below is an example of the main menu for a tool I wrote for my engine. It's basically just a series of nested tables where the root (g_mainMenuDialogDefinition in this case) is sent to C++ to build up the actual widgets. Let me know if you have any questions, it's pretty self explanatory.


      Brainfuck Source Code

      1. -----------------------------------------------------------------------------------------------------------------------
      2. -- MainMenu dialog definition
      3. -----------------------------------------------------------------------------------------------------------------------
      4. local MAIN_MENU_BUTTON_X_LEFT = 15;
      5. local MAIN_MENU_BUTTON_X_RIGHT = MAIN_MENU_BUTTON_X_LEFT + Dialogs.DEFAULT_BUTTON_WIDTH + 5;
      6. local g_mainMenuDialogDefinition =
      7. {
      8. x = Dialogs.DEFAULT_X, y = Dialogs.DEFAULT_Y, w = Dialogs.DEFAULT_W, h = Dialogs.DEFAULT_H,
      9. z = 10,
      10. type = "TexturedWindow",
      11. texture = "textures/MainMenuBack2.jpg",
      12. children =
      13. {
      14. newMapButton =
      15. {
      16. x = MAIN_MENU_BUTTON_X_LEFT, y = 5, w = Dialogs.DEFAULT_BUTTON_WIDTH, h = Dialogs.DEFAULT_BUTTON_HEIGHT,
      17. z = 15,
      18. type = "Button",
      19. texture = "textures/ButtonUp.png",
      20. downTexture = "textures/ButtonDown.png",
      21. command = "Dialogs.newMap:Show()",
      22. children =
      23. {
      24. buttonLabel =
      25. {
      26. z = 20,
      27. type = "StaticText",
      28. font = "fonts/TestFont.bft",
      29. text = "New Map",
      30. },
      31. },
      32. },
      33. loadMapButton =
      34. {
      35. x = MAIN_MENU_BUTTON_X_LEFT, y = 75, w = Dialogs.DEFAULT_BUTTON_WIDTH, h = Dialogs.DEFAULT_BUTTON_HEIGHT,
      36. z = 15,
      37. type = "Button",
      38. texture = "textures/ButtonUp.png",
      39. downTexture = "textures/ButtonDown.png",
      40. command = "QueueEvent(EventType.EVENTTYPE_LOADWORLD, {});",
      41. children =
      42. {
      43. buttonLabel =
      44. {
      45. z = 20,
      46. type = "StaticText",
      47. font = "fonts/TestFont.bft",
      48. text = "Load Map",
      49. },
      50. },
      51. },
      52. saveMapButton =
      53. {
      54. x = MAIN_MENU_BUTTON_X_LEFT, y = 145, w = Dialogs.DEFAULT_BUTTON_WIDTH, h = Dialogs.DEFAULT_BUTTON_HEIGHT,
      55. z = 15,
      56. type = "Button",
      57. texture = "textures/ButtonUp.png",
      58. downTexture = "textures/ButtonDown.png",
      59. command = "QueueEvent(EventType.EVENTTYPE_SAVEWORLD, {});",
      60. children =
      61. {
      62. buttonLabel =
      63. {
      64. z = 20,
      65. type = "StaticText",
      66. font = "fonts/TestFont.bft",
      67. text = "Save Map",
      68. },
      69. },
      70. },
      71. quitButton =
      72. {
      73. x = ((MAIN_MENU_BUTTON_X_RIGHT - MAIN_MENU_BUTTON_X_LEFT) / 2) + MAIN_MENU_BUTTON_X_LEFT, y = 210, w = Dialogs.DEFAULT_BUTTON_WIDTH, h = Dialogs.DEFAULT_BUTTON_HEIGHT,
      74. z = 15,
      75. type = "Button",
      76. texture = "textures/ButtonUp.png",
      77. downTexture = "textures/ButtonDown.png",
      78. command = "QueueEvent(EventType.EVENTTYPE_QUITGAME, {})",
      79. children =
      80. {
      81. buttonLabel =
      82. {
      83. z = 20,
      84. type = "StaticText",
      85. font = "fonts/TestFont.bft",
      86. text = "Quit",
      87. },
      88. },
      89. },
      90. newPaletteButton =
      91. {
      92. x = MAIN_MENU_BUTTON_X_RIGHT, y = 5, w = Dialogs.DEFAULT_BUTTON_WIDTH, h = Dialogs.DEFAULT_BUTTON_HEIGHT,
      93. z = 15,
      94. type = "Button",
      95. texture = "textures/ButtonUp.png",
      96. downTexture = "textures/ButtonDown.png",
      97. command = "Dialogs.newPalette:Show()",
      98. children =
      99. {
      100. buttonLabel =
      101. {
      102. z = 20,
      103. type = "StaticText",
      104. font = "fonts/TestFont.bft",
      105. text = "New Palette",
      106. },
      107. },
      108. },
      109. },
      110. };
      111. -----------------------------------------------------------------------------------------------------------------------
      112. -- Functions
      113. -----------------------------------------------------------------------------------------------------------------------
      114. function CreateMainMenu()
      115. local mainMenu = Dialog:Create({_dialogName = "MainMenu", _dialogTable = g_mainMenuDialogDefinition});
      116. return mainMenu
      117. end
      Display All


      -Rez