Game Development Community

T2D iPhone 1.3.1 GUI Editor Profiles Not Loading

by Darren Decker · in iTorque 2D · 03/23/2010 (1:44 pm) · 12 replies

I spent a good deal of time trying to hunt down the solution to this in the forums with no luck. Can someone explain the reason why the T2D iPhone 1.3.1 GUI editor profiles will not load even though they work in TGBGame? I'm needing a solution to this so I can continue to design the GUIs for my game. I was using version 1.2 with no issues in this area. I'm currently rolling into 1.3.1 and this is a sticking point.

I have this variable initialized in the /common/scripts/projectManagement.cs:

%userGUIProfileFile = expandFilename("game/scripts/guiProfiles.cs");

Like I mentioned this works when using "TGBGame" just fine but not in the "TGBGameBuilder" GUI Editor.

I noticed the "iPhoneExample" does not use GUI objects and thus doesn't implement a test case/demo for using real GUI objects as a GUI. Obviously using sprites as GUI elements is not good practice if you're needing to do camera zooms.

I greatly appreciate the assistance in advance. :-)

#1
03/23/2010 (4:12 pm)
its normally vice versa: its obviously no good practise if you rely on the gui system if you need dynamical stuff thats commonly related to the game camera as the gui is independent of T2D stuff
#2
03/23/2010 (5:21 pm)
If you zoom in and out with the camera the GUI Objects stay the same size. I have no idea why you would say it's the opposite.
#3
03/23/2010 (5:53 pm)
Marc, I'd also appreciate it if you wouldn't hijack my thread on a side bar that you are not correct on to begin with. If you have a reply regarding my actual question that would be fantastic and greatly appreciated.
#4
03/23/2010 (6:13 pm)
what I do is exec my guiProfiles.cs in my managed/datablocks.cs file and then they show up, but if you change the datablocks file though the editor, it deletes it and you need to re add it
#5
03/23/2010 (6:17 pm)
John, thank you very much. Even though this is not perfect it will make using the GUI Editor doable now. Many thanks. :-)
#6
03/24/2010 (5:04 am)
If you build the Debug version of TorqueGameBuilder and use it you will have all your custom profiles and a bunch more show up. And you can then select what ever one you want/need, without fear of it being deleted by the code generator.

I don't know why it works like this, nor have I tried figuring it out. I am lazy like that. :)
#7
03/24/2010 (11:36 am)
Very good to know. Thank you very much.
#8
03/24/2010 (2:24 pm)
I just found out that if you put something like "exec("~/scripts/guiProfiles.cs");" at the top of the file "datablock.cs" in the managed folder you wont need to use the debug version of TGB as I stated above.

#9
03/24/2010 (2:30 pm)
Working in the debug version is actually better for me since if you save the datablock in the editor it will remove the "exec("~/scripts/guiProfiles.cs");". John mentions this in his reply above.
#10
03/24/2010 (2:43 pm)
I just tested the debug version and for me it has the same issue as the release version. So adding the exec line to the datablock appears to be the only band aid fix for now.
#11
03/24/2010 (3:38 pm)
Man I am really spacing it today. Up to this point I was just telling you what I remembered doing.

If you look in the "iT2D/tgb/common/gui/profiles.cs" you will see a bunch of profiles that get added if you have TGB in debug mode. In one of my last games I just copy and past my profiles here and then built my GUI menus. That is why I told you to build TGB in debug. You can do this, but then you have two sets of profiles.

The game I am currently working on I just added this to the end of the file.
exec("/Users/christopherevans/Code/iphone/Games/T2D_iPhone_1_3_1-WordGame/MyProjects/WordGame/projectFiles/game/scripts/guiProfiles.cs");

So I wouldn't have to worry about building a debug version of TGB. Note I had to put the full path because I couldn't go beyond the tgb director.

Hopefully this works for you. :)
#12
03/24/2010 (3:47 pm)
This works! Thank you Christopher!