Game Development Community

Flash of white between showing Default.png and first GUI

by Dave Myers · in iTorque 2D · 05/01/2009 (6:41 am) · 8 replies

I'm a little stumped on this one. As the subject line says, I get a full-screen flash of white between the time the Default.png stops showing and my first screen starts showing. It only lasts a portion of a second, but of course is very noticeable and annoying.

Any clues for me?

About the author

Considerable experience developing with Torque-based technologies and produced the first third-party game using any Torque technology (Orbz). Game designer, programmer, and producer, and credits include the innovative title Orbz and the colorful BuggOut.


#1
05/01/2009 (9:31 pm)
Well, I hacked in something for now that works. There's likely a better way than what I have in there, but I have other fish to fry, yet, so I'm moving on.

As I've seen at least 3 iTGB-based games with the same issue on the App store, I know I'm not the only one that has this problem, minor as it is.

I added in some code to _iPhoneRunTorqueMain() that adds a subview to the Window pointing to the Default.png image. I added the subview to the platState definition.

bool gFirstTime = true;

void _iPhoneRunTorqueMain( id appID, UIView *Window, UIApplication *app )
...
      UIImageView *imgView=[[UIImageView alloc]init];
      imgView.frame=CGRectMake(0, 0, 320, 480);
      UIImage *defaultImage =  [[UIImage imageNamed:@"Default.png"] retain];
      imgView.image = defaultImage;
      [defaultImage release];
      [Window addSubview:imgView];
      [imgView release];
      platState.startupImg = imgView;
...

Then the first time through _iPhoneGameInnerLoop() I remove the subview, otherwise it always stays on top.

...
      if (gFirstTime)
      {
         [platState.startupImg removeFromSuperview];
         gFirstTime = false;
      }
...
#2
05/03/2009 (9:03 pm)
Hey Dave,

I tracked down the source of this problem. When your app first loads up it uses a file called MainWindow located here; engine/compilers/Xcode_iphone( the plist and app icon are also located here ). Pop open this file and change the background color to black or whatever image you want it.
#3
05/04/2009 (8:05 pm)
There's my Mac newbness rearing it's ugly head.

So much better. Thanks for that Eric!
#4
05/25/2009 (8:56 pm)
Granted I'm using the iPhone SDK 3.0 beta right now, but I'm trying to open up MainWindow.xib and it crashes the Interface Builder. I can see it's just a standard XML file, can someone just help me change a few lines or characters to get it to at least flash black instead of white?
#5
05/26/2009 (4:50 am)
Don't install beta SDKs over your stable SDKs is all I can recommend ;)
#6
05/26/2009 (7:47 am)
Can I uninstall it and go back to the regular 2.1 SDK? Is it just as simple as deleting the Developer folder and reinstalling? I don't want to lose the ability to talk to my 3.0 beta 5 device, which the 2.1 SDK could not do. Sorry about hijacking the thread.

Getting back to the topic, what do I have to change in MainWindow.xib?
#7
05/26/2009 (12:30 pm)
@Raphael: Delete the Developer directory, install SDK 3.1.2. Inside the DMG for the beta SDK, there should be some OS 3.0-related files you can install to make SDK 3.1.2 able to talk to your OS 3.0 device.

In the MainWindow, just go to Window Attributes, the first tab in the settings panel. Just to check that you have the right panel:
First section - Window - has settings for Window, Simulated Metrics and Status Bar.

The second section has a lot of settings, including background. Simply change that colour. Cmd-S and quit. That ought to do it.
#8
07/13/2010 (9:46 am)
"Pop open this file and change the background color to black or whatever image you want it."

I haven't been able to choose a background image. All I can find is different tools to change the color. Any help?


EDIT: Someone already answered this for me:
http://www.torquepowered.com/community/forums/viewthread/117835