Game Development Community

The GUI "f10" is all messed up

by Anthony Rosenbaum · in Torque Game Engine · 08/15/2001 (7:20 am) · 11 replies

when I click it, the screen gets highlighted. . .I can highlight the buttons on main screen, but I can't see any real "editor. Did I forget something?

#1
08/15/2001 (8:24 am)
basically there is no interface help !!!
#2
08/15/2001 (8:43 am)
humm, not exactly sure what you mean by there is no editor... if you press F10 the gui editor will start editing the screen you are currently viewing. Should look something like this:
/images/sequence/v12tech/1.jpg
To create a new screen click New..., enter a name (no spaces!), leave the class as 'GuiControl' for now, and press Create. Now you have a clean slate to start working with.

The first thing you will probably want to do is change this top level control to a Content Control so you can add other gui elements to it. In the top right corner you should see the name of your gui, double click it. Now you should see the inspector (lower right corner) fill with information about this control. We want to change the profile to 'GuiContentProfile', so click to the right of profile in the inspector and select it from the list that appears. Click Apply to make the changes take effect. The edit area should turn white.

Now we can start adding other elements! Lets start with a simple button. Click the New Control (lower center) and select 'GuiButtonCtrl' from the popup list that appears. A new button should appear in the upper left corner.

To add text or a script command to that button, select it with the mouse (you should see sizing handles appear when you select it). Now the inspector should be showing info about your new button.

In the text field type: Blah Blah Blah
In the command field type: quit();

Now press Apply to make the changes take effect.

So lets save this gui and try it out. Press Save... (bottom right), a save as dialog will appear. The top popup is a list of directories, select where you want to save it. I recommend leaving the filename the same as your top level control, since the editor chooses that by default. Now press Save.

That's it you just made your first gui!

Now to test it out. You can type the following from the console (press the tilde key) or enter these into your scripts.

exec("/mygui.gui"); -- This compiles and loads the gui into memory
canvas.setContentControl("mygui"); -- This makes "mygui" the active gui.

Now if you press your button, it will execute the script code we entered in the command field, in this case it will exit the text app.

That's it for now. Have fun.

--Rick
#3
08/15/2001 (9:34 am)
oh the problem was in BASE/PREFS/clientPref.cs the

$pref::Video::resolution = "xxx yyy zz";
$pref::Editor::screenResolution = "xxx yyy zz";

was set to low had to rais to 800 600

thanks to Harold Brown for that one
Anthony
#4
08/15/2001 (9:48 am)
I believe he's running the test app at 640x480... I haven't tested but with the way it forces the edit window to 640x480 the other controls may be getting forced off the screen so to speak.


Edit Below:

LoL... I was posting this and stopped typing for a few minutes...
#5
08/15/2001 (9:55 am)
I should put a little check in the script to make sure the screen is at least 800x600. But I am sure the quick tutorial will help someone. :)

--Rick
#6
08/15/2001 (10:47 am)
Just out of interest Rick, what are the profile types used for?

Obviously GuiContentProfile makes it a container for gui content. But whats the GuiClockProfile for instance?

Thought it might be interesting :)

Phil.
#7
08/15/2001 (10:57 am)
Profiles are default settings for many Gui behaviors. Evey Control has a default profile but depending on how you use the controls you might make additional profiles.

The nice thing about the profiles is if you decide to change the behavior or look of some control you don't need to go and edit all your gui's just the profile.

--Rick
#8
08/15/2001 (11:17 am)
You can also change the profile used by a control "on the fly".
#9
08/15/2001 (5:10 pm)
How do you define a new line when using text? for example, i want a box that has 10 lines of writing in, how do i make it so that the text displays properly? instead of running to the right and outside of the text box and becoming invisible?
#10
08/15/2001 (5:13 pm)
I haven't tried this, but can't you put \n where you want the text to break?
#11
08/15/2001 (10:44 pm)
Try the GuiMLTextCtrl just like the one used in the credits dialog (example/client/ui/credits.dlg). It allows for better text formatting control than the simple text control.

--Rick