GUI Problems
by Ryan Zec · in Torque Game Engine · 04/30/2006 (6:55 am) · 3 replies
Ok i was in the GUI editor creating a GuiChuckedBitmapCtrl for a place to put the option to start the game in the Main Menu. I set the HorizSizing to Width and VertSizing to Height, the button for like play, otions, credits, etc... will also use this becuase I want is to resize with whatever they user sets the resolution for the app to. The problem is that I create to control inside the GUI with those setting and the minextent to 8 2 then I go back to the main menu, then went i toggle back to the gui editor, the control I just made is about 1/4 of the size.
here is a list of what i do with pics:
First create control inside Gui Edtor:
Step 1
Look at control in game:
Step 2
Toggle right back into the edit but control is not much smaller:
Step 3
Toggle right back into the game with again the control in mucxh smaller:
Step 4
Does anyone know why this is happening? I would like to get this resolved as soon as possible.
here is a list of what i do with pics:
First create control inside Gui Edtor:
Step 1
Look at control in game:
Step 2
Toggle right back into the edit but control is not much smaller:
Step 3
Toggle right back into the game with again the control in mucxh smaller:
Step 4
Does anyone know why this is happening? I would like to get this resolved as soon as possible.
About the author
#2
05/02/2006 (5:01 pm)
Ok, I was wondering where all the GUI controls are defined in the C++ code? ALso, i know there is a document on using Torque regrading C++ but i can't seem to find that like anywhere if someone can help me out with that, that would be great.
#3
05/03/2006 (8:02 am)
This way I do it. It may not be the best way but it work good. Any time I make change to GUI for example new button. I press f10 to load the GUI editor. I make my change then I save my GUI. Press F10 to exit. I take look at to see if it is what I want. I exit the game before going back in the GUI editor. I notice that if you dont do this it will reset the size and position of new button.
Torque Owner N R Bharathae
Now that you have Torque IDE setup and can save out script changes that stick you should try just copying a control that's already in the script, paste it then make minor changes to see how Torque will take them. Once that's stable you can start writing your own controls.
With regard to resizing GUI controls if you plan to allow players to adjust the screen resolution you need to consider a well known but little documented behavior of Torque. GUI menus can be set to resize automatically but will do so from the lowest resolution available. In other words, if 640 x 480 is the lowest resolution you have in your options list that's the resolution you should build your menus on, not a higher res like 1024 x 1280. When a player selects a new resolution Torque looks at the dimensions and location of GUI elements at the lowest resolution and then scales up from there to the new resolution.
To make this happen you have to set both horizSizing and vertSizing values to 'relative'. That's assuming you're building on the lowest resolution. After saving you can test this by opening the options panel and selecting a new resolution. If done properly your GUI screen should have the same proportions as the lower screen version.
Hope this sheds some light on it for you.