(Resolved) Games displaying in the wrong position/orientation on the simulator (pic)
by Johnny Sprada · in iTorque 2D · 05/22/2009 (10:21 am) · 6 replies
This is a strange problem. It happens for all three games I've tried building to the simulator.
It happens regardless of whether I choose landscape or portrait mode, or if I move the camera.
Only the left half of my game screen shows up on the iPhone simulator, the right half runs off the device. To make matters worse, it's in the wrong position, and wron orientation.
It might be hard to tell what's going on here, but in the screen grab below, all you can see is the left half of the scene. It appears that several objects aren't loading, but it will be easier to get to the bottom of that after I get the screen orientation and position corrected.
I'm expecting the screen to be rotated 90 degrees clockwise, and the whole thing fit to the screen in landscape mode. It would be a pretty big bonus if I could see the other half of the screen, and use the controls on that side!! =)

It should look somewhat like this, but on the phone.

If anyone can provide me some guidance to fix this, it would be much appreciated. Please advise if you need any of my set up options/configurations.
Thank you,
Johnny
It happens regardless of whether I choose landscape or portrait mode, or if I move the camera.
Only the left half of my game screen shows up on the iPhone simulator, the right half runs off the device. To make matters worse, it's in the wrong position, and wron orientation.
It might be hard to tell what's going on here, but in the screen grab below, all you can see is the left half of the scene. It appears that several objects aren't loading, but it will be easier to get to the bottom of that after I get the screen orientation and position corrected.
I'm expecting the screen to be rotated 90 degrees clockwise, and the whole thing fit to the screen in landscape mode. It would be a pretty big bonus if I could see the other half of the screen, and use the controls on that side!! =)

It should look somewhat like this, but on the phone.

If anyone can provide me some guidance to fix this, it would be much appreciated. Please advise if you need any of my set up options/configurations.
Thank you,
Johnny
#2
Make sure your orientation reads like this:
<ScreenOrientation>Landscape</ScreenOrientation>
Also make sure that you resolution is:
<Resolution>480 320 32</Resolution>
The if it lists 320 first and 480 second that would cause some problems as well. Although, I haven't had any issues with orientation or resolution since 1.2 came out.
05/22/2009 (11:14 am)
One thing I do when I have a setting problem like that is check the commonConfig.xml file in xcode before I build to the phone. It should be in the common folder.Make sure your orientation reads like this:
<ScreenOrientation>Landscape</ScreenOrientation>
Also make sure that you resolution is:
<Resolution>480 320 32</Resolution>
The if it lists 320 first and 480 second that would cause some problems as well. Although, I haven't had any issues with orientation or resolution since 1.2 came out.
#3
That did the trick. For some reason, the game builder doesn't save those variables. That's okay, I prefer to control as much as possible, in script.
Thank you!
05/22/2009 (11:31 am)
Thanks guys,That did the trick. For some reason, the game builder doesn't save those variables. That's okay, I prefer to control as much as possible, in script.
Thank you!
#4
Its very annoying as the iphone does not have alternative resolutions so its a total myth why its required to set in two places if there are exactly 2 options, aside from the dead annoying attempt from GG to make iTGB able to build desktop games too, which has naturally all kind of bad impact on the actual iphone games and iphone game development (and is not required, as there is TGB).
05/24/2009 (4:43 am)
You need to set it in the settings and alter the camera in the scene graph to get landscape.Its very annoying as the iphone does not have alternative resolutions so its a total myth why its required to set in two places if there are exactly 2 options, aside from the dead annoying attempt from GG to make iTGB able to build desktop games too, which has naturally all kind of bad impact on the actual iphone games and iphone game development (and is not required, as there is TGB).
#5
Hmmm. The value for this variable is null when I debug this.
Which file do I need to specify $pref::iPhone::ScreenOrientation to landscape?
I have the same problem as the author of this thread, and I'm using a mac. I have not found a prefs.cs file, that people keep referencing, But I do have a defaultPrefs.cs. I tried setting the screenOrientation to landscape there ($pref::iPhone::ScreenOrientation = "Landscape";), but no luck.
My commonConfig.xml looks fine and I did set the settings to landscape in the scenegraph, but that doesn't do anything for me.
For now, I'm just hardcoding in iPhoneWindow.mm after line 175:
platState.portrait = false;
But I would like to avoid this if there is a script workaround. Any insight would be appreciated. Thanks.
06/08/2009 (1:04 pm)
>> Make sure your $pref::iPhone::ScreenOrientation is set to "landscape", put a breakpoint in iPhoneWindow.mm line 166 to see what it is when it's first used (the only time when it counts).Hmmm. The value for this variable is null when I debug this.
Which file do I need to specify $pref::iPhone::ScreenOrientation to landscape?
I have the same problem as the author of this thread, and I'm using a mac. I have not found a prefs.cs file, that people keep referencing, But I do have a defaultPrefs.cs. I tried setting the screenOrientation to landscape there ($pref::iPhone::ScreenOrientation = "Landscape";), but no luck.
My commonConfig.xml looks fine and I did set the settings to landscape in the scenegraph, but that doesn't do anything for me.
For now, I'm just hardcoding in iPhoneWindow.mm after line 175:
platState.portrait = false;
But I would like to avoid this if there is a script workaround. Any insight would be appreciated. Thanks.
#6
http://www.garagegames.com/community/forums/viewthread/80004/2#comments
In case the link is gone:
Comparing my defaultPrefs.cs from my game and a clean project I noticed my game was missing the below:
//platform
if( $platform $= "iphone" ) {
$pref::iPhone::StatusBarType = "BlackTranslucent";
$pref::iPhone::StatusBarHidden = true;
$pref::iPhone::ScreenOrientation = "Landscape";
$pref::iPhone::ScreenUpsideDown = false;
$pref::iPhone::ScreenAutoRotate = true;
$pref::iPhone::UsesNetwork = false;
$iPhoneControls = "Touch";
}
06/08/2009 (6:13 pm)
Okay, I finally figured it out. Someone else posted the solution in a different thread:http://www.garagegames.com/community/forums/viewthread/80004/2#comments
In case the link is gone:
Comparing my defaultPrefs.cs from my game and a clean project I noticed my game was missing the below:
//platform
if( $platform $= "iphone" ) {
$pref::iPhone::StatusBarType = "BlackTranslucent";
$pref::iPhone::StatusBarHidden = true;
$pref::iPhone::ScreenOrientation = "Landscape";
$pref::iPhone::ScreenUpsideDown = false;
$pref::iPhone::ScreenAutoRotate = true;
$pref::iPhone::UsesNetwork = false;
$iPhoneControls = "Touch";
}
Torque 3D Owner Mat Valadez
Default Studio Name
Once that is correct, the screen should be in the right position as well.