GuiTerrPreviewCtrl()
by Edward Gardner · in Torque Game Engine · 09/03/2001 (4:35 pm) · 7 replies
Ok, in the editor, specifically the terraformer, the GuiTerrPreviewCtrl() displays the png file as a background to the "map".
If I use it anywhere else in mission, for instace as a command map:
//--- OBJECT WRITE BEGIN ---
new GuiWindowCtrl(CommandMap) {
profile = "GuiWindowProfile";
horizSizing = "center";
vertSizing = "center";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
maxLength = "255";
resizeWidth = "0";
resizeHeight = "0";
canMove = "0";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "79 404";
extent = "140 30";
minExtent = "8 8";
visible = "1";
command = "canvas.setContent(\"playgui\");";
helpTag = "0";
text = "Back";
};
new GameTSCtrl() {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "15 70";
extent = "268 190";
minExtent = "8 8";
visible = "1";
helpTag = "0";
};
new GuiTerrPreviewCtrl() {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "317 68";
extent = "285 300";
minExtent = "8 8";
visible = "1";
helpTag = "0";
};
};
//--- OBJECT WRITE END ---
All I get is a black square. It tracks ovement and direction just fine, but all I get is a black square :)
What silly thing am I missing?
If I use it anywhere else in mission, for instace as a command map:
//--- OBJECT WRITE BEGIN ---
new GuiWindowCtrl(CommandMap) {
profile = "GuiWindowProfile";
horizSizing = "center";
vertSizing = "center";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
maxLength = "255";
resizeWidth = "0";
resizeHeight = "0";
canMove = "0";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "79 404";
extent = "140 30";
minExtent = "8 8";
visible = "1";
command = "canvas.setContent(\"playgui\");";
helpTag = "0";
text = "Back";
};
new GameTSCtrl() {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "15 70";
extent = "268 190";
minExtent = "8 8";
visible = "1";
helpTag = "0";
};
new GuiTerrPreviewCtrl() {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "317 68";
extent = "285 300";
minExtent = "8 8";
visible = "1";
helpTag = "0";
};
};
//--- OBJECT WRITE END ---
All I get is a black square. It tracks ovement and direction just fine, but all I get is a black square :)
What silly thing am I missing?
#2
I found a few bitmap things in the guis for the terraformer, but nothing that seemed to bring a value into this.
Thanks for the pointers on the code, I'll poke into it tonight.
09/04/2001 (5:07 am)
That's what I was hoping for.I found a few bitmap things in the guis for the terraformer, but nothing that seemed to bring a value into this.
Thanks for the pointers on the code, I'll poke into it tonight.
#3
I looked at those lines, I think I understand them (emp on *think*) but, I am not doing anything special to the control. Am I missing a path construction?
Maybe if I exec my gui control in the editor dir...
09/08/2001 (7:38 am)
I guess the part that is perplexing me, is, why doesn't it just work? Shouldn't the control know to use the bitmap of the current terrain as it's background?I looked at those lines, I think I understand them (emp on *think*) but, I am not doing anything special to the control. Am I missing a path construction?
Maybe if I exec my gui control in the editor dir...
#4
thanks
03/22/2006 (5:40 pm)
I know it's been 5 years since this post... but has anyone got the GuiTerrPreviewCtrl working? It shows arrows for direction, but the background is black..thanks
#5
01/23/2007 (2:39 am)
No idea, doesn't work for me either. Direction / position seems fine, but black background. Hmm!
#6
12/27/2007 (2:37 pm)
Hey are there any Associates who know how to make this work???
#7
I have no idea how I fixed it, but i think I did eventually. Not sure that anything I learned 6 years ago would be relevant now...
12/27/2007 (2:45 pm)
Good lord, this is from 6 years ago...I have no idea how I fixed it, but i think I did eventually. Not sure that anything I learned 6 years ago would be relevant now...
Torque Owner Rick Overman
editor/terriformer.cc line 1275
editor/terriformer.cc line 1284
editor/GuiTerrPreviewCtrl.cc line 117
editor/GuiTerrPreviewCtrl.cc line 202
The control was originally only built for the editor but you might be ale to do what you want with it with a few code modifications or make something very similiar.
--Rick