Problem with GUI button...
by Mitovo · in Torque Game Engine Advanced · 04/05/2014 (11:51 am) · 6 replies
Hello,
So, I'm following the tutorial for editing/creating GUI elements for TGEA. I've gone through all the steps, but have hit a roadblock, in that the button I've created is not opening the dialog window when pressed.
For reference, this is the tutorial I'm following:
http://docs.garagegames.com/tgea/official/content/documentation/GUI%20Editor/The%20Basics.html
Here's a screencap of what I see on my screen:
https://dl.dropboxusercontent.com/u/53548203/GUIProblem.jpg
The only thing I can figure is the problem is that there is no profile available for the button as is shown/demonstrated in the tutorial. If you look at the tutorial, you'll see that there's a drop-down list showing 'GuiButtonProfile' under the GuiControl section of the properties window.
I do not have that option in my local install of TGEA. There's not even a drop-down there. It's just an empty field. I tried typing that in there, but it doesn't seem to be making a difference. I'm thinking that the profile option should be there but, for some reason, isn't.
If anyone can provide some insight as to what's going on, or how to fix it, that would be most appreciated.
Thanks!
So, I'm following the tutorial for editing/creating GUI elements for TGEA. I've gone through all the steps, but have hit a roadblock, in that the button I've created is not opening the dialog window when pressed.
For reference, this is the tutorial I'm following:
http://docs.garagegames.com/tgea/official/content/documentation/GUI%20Editor/The%20Basics.html
Here's a screencap of what I see on my screen:
https://dl.dropboxusercontent.com/u/53548203/GUIProblem.jpg
The only thing I can figure is the problem is that there is no profile available for the button as is shown/demonstrated in the tutorial. If you look at the tutorial, you'll see that there's a drop-down list showing 'GuiButtonProfile' under the GuiControl section of the properties window.
I do not have that option in my local install of TGEA. There's not even a drop-down there. It's just an empty field. I tried typing that in there, but it doesn't seem to be making a difference. I'm thinking that the profile option should be there but, for some reason, isn't.
If anyone can provide some insight as to what's going on, or how to fix it, that would be most appreciated.
Thanks!
About the author
#2
So, is that a pretty reliable "go-to" option when something in the editor isn't jiving? Just open the source files and edit them directly?
Will definitely keep that in mind going forward if that's the case.
I'm like.. 99% Right Brain, 1% Left Brain, so all this programmer stuff is alien to me. Trying to learn, though!
Thanks again :)
04/05/2014 (12:30 pm)
Ahh.. thank you, Richard :)So, is that a pretty reliable "go-to" option when something in the editor isn't jiving? Just open the source files and edit them directly?
Will definitely keep that in mind going forward if that's the case.
I'm like.. 99% Right Brain, 1% Left Brain, so all this programmer stuff is alien to me. Trying to learn, though!
Thanks again :)
#3
Okay, turns out the problem wasn't in the button properties at all. It was actually the dialog popup I was attempting to call. An 'i' snuck in to the name of the dialog window when I was setting it up, and so basically the button is looking for something that isn't there.
Doh.
Now I just need to figure out how to get the 'x' button to close the dialog, which I'm looking into now. It's enabled in the properties, but not working on the dialog itself.
Ah... the fun of finding stupid mistakes!
Edit: Can't figure out why the 'x' button isn't closing the dialog now. Recreated the whole window from scratch, but no dice. Ah well.. Will come back to that at another time. Gonna work on something else for now lol.
04/05/2014 (12:52 pm)
Edit: I'm an idiotOkay, turns out the problem wasn't in the button properties at all. It was actually the dialog popup I was attempting to call. An 'i' snuck in to the name of the dialog window when I was setting it up, and so basically the button is looking for something that isn't there.
Doh.
Now I just need to figure out how to get the 'x' button to close the dialog, which I'm looking into now. It's enabled in the properties, but not working on the dialog itself.
Ah... the fun of finding stupid mistakes!
Edit: Can't figure out why the 'x' button isn't closing the dialog now. Recreated the whole window from scratch, but no dice. Ah well.. Will come back to that at another time. Gonna work on something else for now lol.
#4
04/05/2014 (1:32 pm)
You have to define the window button behavior - the "x" in the top right doesn't do anything by default, even when enabled. So, in the window's definition you need something like this:closeCommand="Canvas.popDialog(HelloWorld);"This field should be in the editor, but if it's not then head on out to the .gui file and fix 'er up.
#5
Seems I have to go back and re-do the entire thing from scratch again. Somehow since the last time I ran TGEA and tested the pop-up (where it displayed the dialog window, but wouldn't close) and now... something got messed up in the code again, and now it won't open the dialog window again.
I'm absolutely bewildered about this whole thing at this point lol.
Things that should be included with the properties windows, but aren't (such as your last response). Things randomly breaking when they worked just fine before, and no changes have been made since. This is just bizarre.
Anyway.. Let me see if I can do it all again from scratch and maybe it'll all just "work" this time.
Is T3D this quirky and fussy? I might seriously just say "Uncle" with TGEA, and move over to T3D instead. As much as T3D just doesn't "click" with me and I get the warm fuzzies from TGEA, I might seriously just go over to that at this point. Geeze! lol
04/05/2014 (2:20 pm)
Thanks again, Richard.Seems I have to go back and re-do the entire thing from scratch again. Somehow since the last time I ran TGEA and tested the pop-up (where it displayed the dialog window, but wouldn't close) and now... something got messed up in the code again, and now it won't open the dialog window again.
I'm absolutely bewildered about this whole thing at this point lol.
Things that should be included with the properties windows, but aren't (such as your last response). Things randomly breaking when they worked just fine before, and no changes have been made since. This is just bizarre.
Anyway.. Let me see if I can do it all again from scratch and maybe it'll all just "work" this time.
Is T3D this quirky and fussy? I might seriously just say "Uncle" with TGEA, and move over to T3D instead. As much as T3D just doesn't "click" with me and I get the warm fuzzies from TGEA, I might seriously just go over to that at this point. Geeze! lol
#6
All of the Torque products grew from the same seed, so they share many quirks. T3D is no better or worse in this regard. It sure does look prettier though....
04/07/2014 (6:46 am)
Always keep your eye on the console.log file - the errors there will give important hints as to what's going wrong. For instance, if you followed my last post exactly then that gui probably failed to load - I forgot the semi-colon at the end of the line....closeCommand="Canvas.popDialog(HelloWorld);";And that would have been printed in the log ("failed to load HelloWorld.gui" or something similar).
All of the Torque products grew from the same seed, so they share many quirks. T3D is no better or worse in this regard. It sure does look prettier though....
Torque Owner Richard Ranft
Roostertail Games
Should resemble this:
// example of a normal button control - you should search for yours by the contents of the text field.... new GuiButtonCtrl() { text = "Play"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "1"; position = "9 114"; extent = "289 75"; minExtent = "8 8"; horizSizing = "relative"; vertSizing = "bottom"; profile = "GuiMenuButtonProfile"; visible = "1"; active = "1"; command = "Canvas.pushDialog(ChooseLevelDlg);"; tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "0"; canSave = "1"; canSaveDynamicFields = "0"; };