Game Development Community

Window not centered on iphone, whitespace on left and bottom

by Gregory Ray · in iTorque 2D · 09/14/2008 (7:22 pm) · 15 replies

Hey guys it's me again. I finally got the shooter running on my iphone and sim but now there is a white space (120px on the left and 80px on the bottom), I have tried to change the camera size and resolution and camera position but it always had the same whitespace. Anyone else experiencing this? Anyone have any ideas on where I might look in the code for this kind of positioning?

#1
09/16/2008 (2:07 pm)
It looks like you have not t2dSceneWindow resized on whole screen. Try to check it.
#2
09/17/2008 (10:21 am)
Logs:

[Session started at 2008-09-17 10:53:59 -0600.]
Initial Command Line
0 : /Users/gregoryray/Library/Application Support/iPhone Simulator/User/Applications/D9EE0BF3-A298-461D-9F1B-60E7DC087D3A/TGBGame.app/TGBGame
Merged Command Line
0 : /Users/gregoryray/Library/Application Support/iPhone Simulator/User/Applications/D9EE0BF3-A298-461D-9F1B-60E7DC087D3A/TGBGame.app/TGBGame
performing mainInit()
common/preferences/defaultPrefs.cs (98): Unable to find function initDisplayDeviceInfo
Failed to initialize driver.
game/gameScripts/game.cs (21): Unable to find function enableJoystick
installing main loop timer = 16 ms.
game/behaviors/game/shootsAdv.cs (67): Unable to find function playSound
game/behaviors/game/shootsAdv.cs (67): Unable to find function playSound
game/behaviors/game/shootsAdv.cs (67): Unable to find function playSound

[Session started at 2008-09-17 11:02:54 -0600.]
Initial Command Line
0 : /Users/gregoryray/Library/Application Support/iPhone Simulator/User/Applications/A004EB24-87F2-49A3-A75C-92EE7FB6399B/TGBGame.app/TGBGame
Merged Command Line
0 : /Users/gregoryray/Library/Application Support/iPhone Simulator/User/Applications/A004EB24-87F2-49A3-A75C-92EE7FB6399B/TGBGame.app/TGBGame
performing mainInit()
common/preferences/defaultPrefs.cs (98): Unable to find function initDisplayDeviceInfo
Failed to initialize driver.
game/gameScripts/game.cs (21): Unable to find function enableJoystick
installing main loop timer = 16 ms.
#3
09/17/2008 (5:55 pm)
Are you using your own 'common' folder? If so, try the one from BehaviorShooter.
#4
09/17/2008 (7:31 pm)
Not sure why I was having this issue but I finally gave in and cleared my entire development environment and resetup the environment from scratch and it worked :) Thanks guys.
#5
09/26/2008 (1:19 pm)
Guys how do u set up the engine?
#6
11/05/2008 (2:14 am)
Hi Gregory,

I'm having the same issue as you.. What do you mean with "cleared my entire development environment and resetup the environment from scratch". Other than completely delete ITGB from my harddrive, I'm really out of ideas.. :)

Thanks!
#7
11/05/2008 (1:39 pm)
You just select the scene graph and give it the correct size / use the new settings possibility.

then you alter the config xml in XCode (within the common folder) to define if your game is horizontal or vertical

and compile + deploy it

that should do it.
#8
11/05/2008 (2:00 pm)
Thanks Marc, today on my windows machine I saw that the resolution was not correct, and hoped it would be it... As soon as I get my hands on my Mac, I'll try it.

Thanks!!
#9
11/05/2008 (3:58 pm)
Let us know if it worked :)

more fellow iTGBers are always nice :)
#10
01/06/2009 (7:01 am)
Just to close this one, it worked perfectly.

Thanks!
#11
01/06/2009 (11:11 am)
Everytime you open your project in iTGB you have reset your design surface sizes because iTGB resets it to 800 x 600 whenever it loads. This caused me all kinds of problems in the beginning and still does occasionally when I forget to do it. The "effect" of missing it is usually white background in the bottom left area and only a little of your real screen showing in the upper right area.

Also from my experience you have to be super diligent about removing the game,common,main.cs files from your project, doing a full clean for your target build, then readdding and rebuilding the target or you'll miss changes you made etc.

Pretty tedious for me right now because I'm still learning what works, what doesn't and how different things perform on the iphone so I regularly rebuild and run on my actual device to see how things effect performance. But I imagine once I'm more knowledgable it won't be such a pain.
#12
01/07/2009 (9:13 am)
Set the proper screensize (320x480 or 480x320) of scenegraph.
#13
01/29/2009 (2:31 pm)
"Everytime you open your project in iTGB you have reset your design surface sizes because iTGB resets it to 800 x 600 whenever it loads."

ugh! I'm assuming this will be fixed... soonish.

*edit*

If you are on a mac (no idea how to do this on winders) you can make commonConfig.xml read-only. That is assuming that you don't need to do anything with it after the initial setup. "chmod -w" or you can get info on the file in the finder.

At least then you don't have to adjust it every time you load it into TGB. The Design Resolution still says 800x600 but it doesn't actually change it, and when you play a scene it's the correct resolution.
#14
04/03/2009 (11:19 pm)
One of my alphas was suffering from the same off-center scene graph. Manually overriding both the common config XML (<Resolution>480 320 32</Resolution>) and mainScreenGUI to the proper resolution did the trick. Don't forget to check mainScreenGUI!
#15
04/29/2009 (3:03 pm)
The game/gui/mainScreen.gui seemed to be the problem for me! Thanks for the tip, Ronald.