Game Development Community

TGB GUI Builder profile problems.

by Peterjohn Griffiths · in Torque Game Builder · 05/07/2011 (4:54 am) · 17 replies

TGB 1.7.5
TGB 1.7.4
TGB 1.6.0
I have been looking into a problem with the GUI Profiles not showing in the GUI Builder.
I was using TGB 1.7.5 when I found this problem.

[How to find the problem]
I create a new project.
Make sure that new project is the one loaded.
Go into the Gui Builder.
Open mainScreen.gui
I add a GuiBitmapButtonTextCtrl and with it selected I try to change the profile to GuiButtonProfile but instead of there being loads of GUI profiles, I only have 5.

Here is a screenshot of the problem.
www.uklanparty.net/images/TGB1.6.0-GuiProfilesMissing.jpg
I have uninstalled and then installed 1.7.4 but still the same.
I uninstalled and then installed 1.6.0 but still the same.

When I installed TGB 1.5.1, all the GUI profiles are there, so it would seem that this has been a problem fince TGB 1.6.0

Has anyone else got this problem?.

#1
05/07/2011 (5:35 am)
I loaded some 1.6.0 games into 1.5.1 and they don't seem to have the problem.
I then loaded some 1.5.1 games into 1.6.0 and they have the problem.
I have copied across scrips from the 1.5.1 version of TGB into 1.6.0 for all GUI's, GUI editor and editor classes, but TGB 1.6.0 still has the problem.
Seems to be something in the engine not the script files doing this.

If I copy TorqueGameBuilder.exe from 1.51 install dir into 1.60 install dir, TGB 1.60 loads the profiles fine.

The help says T2D v1.51 and TGB 1.60
This proves the problem is with T2D in the TorqueGameBuilder.exe file.

This is now beyond me to track this down as I havn't stepped into the engine yet.
#2
05/15/2011 (11:31 pm)
Can anyone else confirm how many gui profiles they get and what TGB version they are on please.
#3
06/04/2011 (4:11 pm)
I know this is old, but yeah, you are right, and it is a big problem. I was hoping someone had found a fix :(
#4
06/04/2011 (5:13 pm)
Confirming they aren't showing in 1.7.5. I forgot this was even a problem because I started adding profiles of my own as I needed.
#5
06/05/2011 (3:35 pm)
@smally
I don't suppose you have a link to a decent tutorial/resource on doing this? The official documentation doesn't seem to have anything useful (unless I somehow missed it), and I don't really have the time to go through and figure it out from the available examples for my current project (school).
#6
06/05/2011 (4:37 pm)
I can write a small one. I don't mind doing that for anyone here. I just looked through the code and the samples provided and went to writing the profiles I wanted to use. Since there are a limited set of properties it's not too bad to do.
#7
06/06/2011 (4:58 am)
@smally
You're probably right, I guess I just need to stop being lazy, haha.
#8
06/06/2011 (5:37 am)
I didn't say you were being lazy.. I'm used to programming and everything that comes with it. Been doing it too long, lol. I don't expect that from anyone else. I'll write up a resource inside of TDN for creating GUI Profiles.
#9
06/06/2011 (8:31 am)
Oh no, no, no, I wasn't implying you were! I was calling myself lazy. Seriously though, you rock and that would be awesome.
#10
06/06/2011 (12:32 pm)
Not a problem.. It's no worries, I've had my head in the code for this engine for the last week, and I've learned more than I think I wanted to about it's structure and operation, lol. Will give you the link here when done.
#11
06/09/2011 (12:22 am)
Some info on this would be great Smally.
I realy need GUI profiles and just the basics to get me started would be fantastic. :D
#12
06/09/2011 (1:40 pm)
Workin on it guys, Really.. I'll have something hopefully ready for everyone by monday.. I'm documenting what I can in the time I have :D :D
#13
06/11/2011 (12:18 pm)
Ok, so if you have source access to TGB, here is a fix I've implemented on my codebase to fix the issue of the default or "common" profiles not showing up in the GUI Builder. This I hope is a start.

tdn.garagegames.com/wiki/TGB/Resources/Making_the_Default_GUI_Profiles_Show_Up_i...

Aaaaand for some reason, when I try to add the link to the resource on the resource page inside of TDN, I'm getting a blank page ... So for now, this will have to do, till I can get around that little issue.. ;)
#14
06/11/2011 (1:47 pm)
Wow, I wish I would have looked through the docs much sooner than I did.. Ok here is a link to the reference for GuiControlProfile which will detail what fields are available for a profile.
tdn.garagegames.com/wiki/TGB/Reference:_GuiControlProfile

To make your own profile edit the file "game/gameScripts/guiProfiles.cs". Go to the end of the file, or wherever you want to place your profile, and write your profile datablock. Below is an example of one I made, simply:

if(!isObject(WhiteTextProfile)) new GuiControlProfile(WhiteTextProfile)
{
   fontType = "Arial";
   fontSize = 16;
   fontColor = "255 255 255 255";
};

You should always check if the profile you want to create has already been created. Hence the "if(!isObject(WhiteTextProfile)) new" portion.
Otherwise, you just specify the class as written.

new GuiControlProfile(profileNameHere) {
   //profile attributes here
}

All Gui profiles that I know of inherit from GuiControlProfile somewhere along their inheritance chain. Could be wrong, but fairly sure about this.

And just for quick reference.... Here is a link to a pdf I created from the reference documentation.
www.embermill.com/gg/GuiControlProfile.pdf

Hope this helps!

#15
06/12/2011 (5:19 am)
Fantastic Smally,
I will be testing this tonight and hope I can get some profiles working with my GUI's.
I'm like a kid in a sweet shop....Can't wait to get started.
#16
06/13/2011 (4:17 am)
Sorry for the late thank you, but THANK YOU! This rocks and you rock.
#17
06/13/2011 (8:34 am)
Thanks.. I don't mind helping where I can, when I have the time.. and you guys touched on an issue I completely forgot about since.. So I kinda wanted the same functionality anyway. :D