Game Development Community

Simulating iPhone game (appearing stretched in portrait mode)

by Mr Zurkon · in iTorque 2D · 08/07/2011 (4:56 pm) · 8 replies

I've recently tried to deploy/test an it2d game on an actual iPhone (3g), but for some reason the resolution appears different from what it does when using the simulation tools in xcode.

I've set screen orientation to portrait and resolution to 320x480 in TGB. I've also checked "portrait mode" in xcode to be sure.

When I'm trying to run the game on an actual phone the game appears stretched as if it was in landscape mode (however, the orientation of the game is correct). This does not happen when simulating an iphone on the mac. The aquarium example (landscape) works without any problems.

Anyone have an idea what might be causing this issue? Do I need to set the resolution in xcode as well? I didn't specify anything for the aquarium example and it worked perfectly.

#1
08/07/2011 (11:17 pm)
Found this in the log:
Torque Game Builder (v1.7.5) initialized... 
iTorque 2D v1.5 is active... 
Executed /private/var/mobile/Applications/5FC4D806-E25A-4B6F-B475-6D75B66FB502/iTorque2DGame.app/game/scripts/datablocks.cs. Took 6 ms 
Failed to load profile bitmap () 
Loaded compiled script /private/var/mobile/Applications/5FC4D806-E25A-4B6F-B475-6D75B66FB502/iTorque2DGame.app/game/gui/mainScreen.gui. Took 143 ms 
% - MainScreen set to Landscape! 480x320  
--------Loading Resource file game/PlatformerArt/emptyLevelResources.cs 
--------Adding to Level game/data/levels/emptyLevel.t2d 
--------Exec()ing level datablocks game/data/levels/datablocks/emptyLevel_datablocks.cs 
Loaded compiled script /private/var/mobile/Applications/5FC4D806-E25A-4B6F-B475-6D75B66FB502/iTorque2DGame.app/game/data/levels/datablocks/emptyLevel_databl
see line 6: "mainscreen set to landscape". When I try to build on the iPad (exact same version of the game), it says "set to portrait" like it should, because that's what i've defined everywhere. For some reason the iPhone (3g) is ignoring this and setting it to landscape anyway.
#2
08/08/2011 (6:27 am)
That's weird. I'll try to test this on an iPhone and iPod later today.
#3
08/24/2011 (8:26 am)
I tried to set it manually in main.cs where I edited
mainScreenGui.Extent = "480 320"
sceneWindow2D.Extent = "480 320"

to "320 480", but still nothing happens. I also added something to the echo statement so I could make sure that it read the file. Are there any other places I can override landscape to portrait manually? I found some earlier threads on this issue, but it seems it was fixed with 1.4 (?). I'm using 1.5 preview 1.

as i mentioned earlier, this is not an issue when running it with simulator.
#4
08/24/2011 (9:10 am)
Check your camera settings in the level file (.t2d).
#5
08/24/2011 (11:28 am)
cameraSize = "320 480";
is what it says
#6
08/24/2011 (12:48 pm)
not sure if that will help, but that is portrait.


???
#7
08/25/2011 (10:45 am)
Yes, I'm trying to make it run in portrait. The problem is that it runs in landscape regardless of what I specify. This only occurs on a (real, non-simulated) iphone 3g. It works when using the simulator.
#8
07/16/2012 (4:46 pm)
hi, I'm wondering how do I run my app on my iphone, I use itorque 2d 1.5 with latest xcode and iphone 3gs. Also, can someone PLEASE tell me how do I use the gyroscope as controls in my code?