Game Development Community

Bitmap not showing

by Nathan Kent · in Game Design and Creative Issues · 07/22/2008 (11:48 am) · 10 replies

I've done very little work with Torque's GUI system. You have been warned.

I have a splash-screen gui that wont display it's bitmap. It's showing when it should, but it's just white, and if I load it up in the Gui Editor, it will work perfectly.

Here's the GUI:
new GuiFadeinBitmapCtrl(GgSplashGui) {
   canSaveDynamicFields = "0";
   Profile = "GuiDefaultProfile";
   HorizSizing = "width";
   VertSizing = "bottom";
   Position = "0 0";
   Extent = "640 480";
   MinExtent = "8 8";
   canSave = "1";
   Visible = "1";
   hovertime = "1000";
   bitmap = "./GarageGames";
   wrap = "0";
   fadeInTime = "500";
   waitTime = "3375";
   fadeOutTime = "250";
   done = "0";
      noCursor = true;
};

function loadSplashScreens()
{
   Canvas.setContent( GgSplashGui );
   schedule(4125, 0, loadSplash2 );
}

Any ideas?

#1
07/22/2008 (11:55 am)
Where is the file? The . in the filename implies both this code and the image for it are in the same folder
#2
07/22/2008 (11:58 am)
Both of them are in "main/client/ui". It's finding the image when I edit the GUI in the editor, but not when I play it with loadSplashScreens().
#3
07/23/2008 (3:48 pm)
This is effecting GuiBitmapControls too, now. After finally getting the console back in my game, I was able to run through the Splash Screens again, and after the second time, they are perfect. Maybe I'm supposed to initialize each gui somehow, and I'm not?
#4
07/31/2008 (2:31 pm)
BUMP

Still haven't figured this out. Maybe I should try quadruple posting instead of just triple. =P
#5
07/31/2008 (2:42 pm)
If both, the bitmap and the .gui file are in the same folder do you need the "./"? How about just
bitmap = "GarageGames";
#6
07/31/2008 (3:59 pm)
Yep, you need it. The "./" shows that it's in the same folder, without it, the engine is looking for "BaseDirectory/GarageGames" instead of "BaseDirectory/Game/Client/ui/Garagegames".

The images show up the second time, just not the initial one.
#7
07/31/2008 (5:01 pm)
It seems like Torque sometimes fails to understand relative path. Why don't you try putting
bitmap = "yourproject/client/ui/GarageGames" instead of bitmap = "./GarageGames"?
#8
07/31/2008 (7:06 pm)
Nope, that's not it either, because the exact same thing happen. I don't think that the problem lies in the path, I think that I'm forgetting some nessisary field, or forgetting to "initialize" it, or something....
#9
08/06/2008 (6:41 am)
For anyone who has this problem in the future, here's the solution:
Execute the files after you make the canvas.
#10
06/11/2010 (6:37 pm)
I want to add to this discussion because I had the same issue in T3D (1.1 b1). I actually used the GUI editor and set the image property of the GUIControl. Everything looked great in the editor but nothing displayed in the game. Here is what I had to do:

/game/scripts/gui/startupGui.cs

function loadStartup()
{
...
StartupGui.bitmap() = "art/gui/startup"; //for my startup.png
...
}

This took care of the problem. It seems that this code is overriding the property of the GUI itself.