GuiBitmapCtrl invisible with t2dSceneWindow??
by Michael Woerister · in Torque Game Builder · 05/13/2006 (5:48 am) · 5 replies
Hi,
everytime I place a GuiBitmapCtrl on a t2dSceneWindow in the GUI editor the GuiBitmapCtrl becomes invisible. Is that not allowed?
-Michael
everytime I place a GuiBitmapCtrl on a t2dSceneWindow in the GUI editor the GuiBitmapCtrl becomes invisible. Is that not allowed?
-Michael
#2
05/26/2006 (4:19 pm)
No, even in the GUI editor it is invisible. But that was with Beta3. I don't know if it is working now.
#3
Edit:
I also find that, if I do anything to the default mainScreen.gui, it will choose to fail to find "logoblack" (I think it's weird that the engine will normally find "logoblack.png" by being told "logoblack" but won't find my jpg with or without a full path) and I get either a broken v-hold effect or seizure-inducing blinking. It's extremely confusing because the GUI system doesn't seem to follow any logic or scoping rules at all.
05/28/2006 (5:53 pm)
I'm having a similar problem as well, with GuiControl on Beta4. When I run the game, I get the buttons and an outline around the where the picture should be (there's supposed to be text too, but it's black and the editor won't let me set a menu's background color so it's lost in the Torque logo). Then when I load the GUI editor back up, the image placeholder is there but it decides not to show the image.Edit:
I also find that, if I do anything to the default mainScreen.gui, it will choose to fail to find "logoblack" (I think it's weird that the engine will normally find "logoblack.png" by being told "logoblack" but won't find my jpg with or without a full path) and I get either a broken v-hold effect or seizure-inducing blinking. It's extremely confusing because the GUI system doesn't seem to follow any logic or scoping rules at all.
#4
As for your second problem, im sorry, i havent run into anything like that.
05/29/2006 (4:08 pm)
@ Ryan, your first problem is because for some reason, the GUI editor is incorrectly setting the relative paths of your images, or at least not recognizing them. I've had the same problem, and there isnt really anything you can do about it except to dig into the gui editor code and fix it, or wait for GG to do it and release a fix. As for your second problem, im sorry, i havent run into anything like that.
#5
Regarding menus, what I have inside startGame() in game.cs is:
Canvas.setCursor(DefaultCursor)
Canvas.setContent(MyMenu1);
MyMenu1 is a GuiBitmapControl (with the Torque background) with a GuiMouseEventControl (or some variant, you'll see it). I think I have it stretched out to the same size as the menu, and set to width/length for horizontal/vertical sizing. That's so the clickable area statys the same size as the menu. Then in MyMenu1.gui I have at the bottom:
function MyMouseEvent::onMouseDown(%something1, %something2, %something3, %something4)
{
Canvas.setContent(MyMenu2);
}
MyMenu2 is alot like MyMenu1 except it's got buttons and pictures on it instead of a mouse event. That's about as far as I got with it last night. I got hung up on aligning stuff with it (I wanted 2 images side by side but centered as a group) until another person from IRC helped out. Turns out you put a GuiBitmapControl on your existing menu and make the 2 images children of that control. But this is the tricky part - the order you do this determines whether it works or fights you.
1. Click the item (in my case, the picture) in the viewport.
2. Find that item in the tree list over on the right.
3. Drag tree list item into tree list parent.
Supposedly I should be able to do the same thing with MyMenu2's controls to load the mainScreenGUI (the default one that loads with the levelbuilder) and then do the actual game in there (I'm not sure why I see pushDialog() and popDialog() when setContent() works but hey). I'll try that next time I have time to fool around with the project. Just thought I'd pass along what I'd learned in the meantime and hope it saves somebody some aggravation. Sorry to have gone off away from original post :/
05/30/2006 (10:12 am)
Yep, this was explained to me by some very helpful people on IRC the other night. It turns out the v-hold and blinking issues were caused the same way, by the editor/compiler/loader not finding the images for dialogs with bitmap backgrounds. For the sake of anybody else having the problem, you've got to open your *.gui files with a text editor and set your graphics paths to "yourgamehere/data/images/filenamewithoutexension" instead of "~/whateverisalreadythere.jpg"Regarding menus, what I have inside startGame() in game.cs is:
Canvas.setCursor(DefaultCursor)
Canvas.setContent(MyMenu1);
MyMenu1 is a GuiBitmapControl (with the Torque background) with a GuiMouseEventControl (or some variant, you'll see it). I think I have it stretched out to the same size as the menu, and set to width/length for horizontal/vertical sizing. That's so the clickable area statys the same size as the menu. Then in MyMenu1.gui I have at the bottom:
function MyMouseEvent::onMouseDown(%something1, %something2, %something3, %something4)
{
Canvas.setContent(MyMenu2);
}
MyMenu2 is alot like MyMenu1 except it's got buttons and pictures on it instead of a mouse event. That's about as far as I got with it last night. I got hung up on aligning stuff with it (I wanted 2 images side by side but centered as a group) until another person from IRC helped out. Turns out you put a GuiBitmapControl on your existing menu and make the 2 images children of that control. But this is the tricky part - the order you do this determines whether it works or fights you.
1. Click the item (in my case, the picture) in the viewport.
2. Find that item in the tree list over on the right.
3. Drag tree list item into tree list parent.
Supposedly I should be able to do the same thing with MyMenu2's controls to load the mainScreenGUI (the default one that loads with the levelbuilder) and then do the actual game in there (I'm not sure why I see pushDialog() and popDialog() when setContent() works but hey). I'll try that next time I have time to fool around with the project. Just thought I'd pass along what I'd learned in the meantime and hope it saves somebody some aggravation. Sorry to have gone off away from original post :/
Torque Owner Anthony Fullmer