Your First GUI Tutorial

From TDN

The purpose of this tutorial is to show you how to create a GUI and link it to your project so that you can use it with your game.

  1. Load a level in TGB.
  2. On the menu bar, click Project > GUI Builder. The GUI Builder opens.
  3. On the menu bar, click File > New GUI. The Create New GUI dialog box opens.
  4. Click Create. Your new GUI opens in the GUI Builder.
  5. From the New Control drop-down list, select a control to add to your GUI. The control is added to your GUI.
  6. On the menu bar, click File > Save GUI. The Save File dialog box opens.
  7. In the menu tree, navigate to your project, click on the gui folder, and click Save File. Your GUI, guiNewGui.gui, is saved.
  8. In your project folder, open main.cs in a text editor.
  9. Add the following line in initializeProject() near the top: exec("~/gui/guiNewGui.gui");
  10. Save main.cs. You can now reference your GUI in your game.

Note: If you do not reference your GUI in main.cs, it will not appear in the GUI Builder's GUI list the next time you load your project in TGB. In the GUI Builder, The list of existing GUIs appears in the drop-down list to the right of the New Control drop-down list.