Game Development Community

Basic GUI creation help needed

by Lennart Steinke · in Torque Game Builder · 06/02/2007 (8:29 am) · 1 replies

Hi!

Just downloaded the 1.5 beta and wanted to start with something simple. Just a few GUI screens with a couple of simple elements and buttons to connect these screens together.

Problem is: the documentation doesn't seem to cover this.
Basically, I want a menu screen leading to an options screen (which will return me to the menu screen) and a player profile screen which can lead to two other screens which will then lead to the menu screen again.

Menu
+---> Options -- [Ok / Cancel]--> Menu
+---> Profile
+--- [ new profile ] -> Create Profile --- [Ok / Cancel] --> Profile
+--- [ load profile ] -> Profile Loaded --> [Ok / timeout] -> Menu


The Basic GUI Tutorial doesn't seem to be meant for TGB owners, and the TGB reference seems to list only the properties of the controls.

It would be great if you could give some links to tutorials / documentation describing the gui editor.

Best regards,
Lenny

#1
06/05/2007 (9:20 pm)
The GUI builder will simply let you arrange buttons and images and text boxes etc. You will have to write some code to make those widgets do things. For example the code you want to create and load "profiles" (a vague term here.. do you mean player names? Saved game-state data? Or actual TGB GUI profiles? ) this would need to be in a script file and loaded with your .gui files.

The documentation does cover changing from one gui to another. It's easy. Take a look at Canvas.pushdialog() and Canvas.popdialog().

I learned a lot about the way the GUI system works here in the Mini GUI Tutorials:
tdn.garagegames.com/wiki/TGB/MiniTutorials
My game menus work a lot like you describe, and are based on tutorials you can find there. You may also be interested in the book "Game Programmers Guide To Torque" which has plenty of GUI example code on the CD.