Game Development Community

Support for the new iPhone 5 + 5th gen iPod Touch

by Scott Wilson-Billing · in iTorque 2D · 09/12/2012 (12:30 pm) · 28 replies

Anyone any thoughts on how we might implement in iT2D?
Page «Previous 1 2
#1
09/12/2012 (12:54 pm)
With such a screwy aspect ratio, I'd say "very carefully". We'll need to get our hands on the SDK version that supports it and see how much has changed.
#2
09/12/2012 (1:36 pm)
Agreed David, it seems kind of odd, i.e. not a simple doubling or even 1.5. It's only the height that has changed or the width if you are in landscape. Can't even re-work 1024x768 assets.
#3
09/12/2012 (1:41 pm)
They must have taken something from the Vita handbook. It's resolution is 950x544 for an aspect ratio of 475:272. 71:40 for the iPhone 5's not quite as weird, but yeesh! Whatever happened to 4:3 and 16:9 or even 3:2 like the previous iPhones?
#4
09/12/2012 (1:52 pm)
But 1136x640 *is* 16:9, more or less. Just not the 16:9 every developer wished for :/
#5
09/12/2012 (5:44 pm)
Lets not forget the supposed iPad mini possibly debuting next month.
#6
09/12/2012 (9:00 pm)
That one could be 1024x768…or 1366x1024.
#7
09/13/2012 (7:12 am)
No me gusta.
#8
09/24/2012 (4:19 pm)
Hi guys,

My app using iTorque2D version 1.5 is just rejected by apple, saying We found that your app crashed on iPhone 5 running iOS 6, which is not in compliance with the App Store Review Guidelines.

I just can't understand why apple changed the ratio to such strange one, but could you guys please update the engine and fix the crash problem for me?

Thanks!
#9
09/24/2012 (8:17 pm)
Ratios shouldn't be a problem since iTorque is coded to give a 320x480/640x960 viewport with an empty bar for the iPhone 5. I haven't seen anything on the simulator.

One source of crash rejections was added with XCode 4.4. Compiling with optimization causes iT2D to crash on startup. Check to see if your release/shipping builds use optimization - normally not present in debug builds.
#10
09/26/2012 (6:21 am)
Thanks for that optimize fix Paul. My app was crashing with Xcode 4.5, iOS 6 on an iPad 3 until I turned off the build optimizations. For anyone else getting this problem - go to your project's build settings and search for 'optimization level'.
#11
10/01/2012 (5:30 pm)
Maybe someone can tell me if this won't work, especially regarding the iPhone5.

For my universal apps, to minimize my workload, I just change my camera's aspect ratio. Basically, it crops down to 3:2. I make sure objects in my levels are moved within screen boundaries, too, so I don't have anything cut off on the edges. Is there some reason that we can't do this on the iPhone5? Can't we just essentially expand the camera out to 16:9?
#12
10/01/2012 (7:19 pm)
@Joe - This is what I think is possible.

What you can do is have your GUI Control at 1136x640 and have a windows scene (gameplay scene) in it that is 960x640. You can then dynamically changed the GUI Control from 1136x640 to 960x640, but your main scene will always be 960x640 and centered.

So in short, yes your suggestion should work. Nothing I said above has been tested so please do not hold me to it.
#13
10/02/2012 (9:26 pm)
Is anyone else getting a crash when testing in the 6.0 simulators? I don't have consistent access to an iOS 6 device, so I'm trying to use the sims, but I keep getting "error: failed to attach to process ID 0." It runs fine in the 5.0 and 5.1 sims, and on my 5.0 and 5.1 devices. Any ideas? The only thing I've changed is commenting out #include <Math64.h> from profiler.cc. That's the only way I could get anything to compile after the upgrade.

Anyway, anyone been able to get iT2D to launch on the 6.0 sims?
#14
10/07/2012 (3:13 pm)
I figured out the crash. Launching straight from Xcode doesn't work, but if I launch the app from the simulator's home screen, then everything is fine. Weird. Regardless, it works on iOS 6 devices, so I'm not concerned.

So, anyway, next question: in code, how do we identify the new iPhone/iPod Touch?
#15
10/07/2012 (5:55 pm)
@Joe - The new resolution system I worked on was able to detect iPhone vs iPad, then whether the device was retina capable. It was a lot cleaner than the iT2D v1.5 resolution handling. I'll be digging into the new iOS 6 and iPhone 5 resolution detection as soon as my new hardware shows up.
#16
10/17/2012 (12:55 am)
Okay, I was able to run one of my games on the iphone 5 resolution (1136x640) and everything ran fine. For the current game I'm working on I'm only supporting 960x640 and 1136x640.

BTW, I'm using a heavily modified iTGB 1.3x.
#17
10/20/2012 (2:43 am)
@Jhonny

hei you set different xib ?

and add new resolution in c++ and script ?


#18
10/29/2012 (11:21 am)
@Andrea

I had to set the new resolution in C++ and script. You have to update the touch functions in c++ to work with the new resolution also.
#19
10/29/2012 (9:41 pm)
Johnny, how did you identify the iPhone 5? I'm looking at this in iPhoneWindow.mm:

if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)  
    {  
        if ([[UIScreen mainScreen] scale] == 2)  
            Con::setVariable("$platform", "ipad3");  
        else  
        {  
            Con::setVariable("$platform", "ipad");  
        }  
    }  
    else  
    {  
        if([[UIScreen mainScreen] scale] == 2)
            Con::setVariable("$platform", "iphone4");  
        else  
            Con::setVariable("$platform", "iphone");  
    }

and can't figure out how to see if it's an iphone 5 based on UIScreen mainScreen. I don't know enough about Objective-C, unfortunately.
#20
10/29/2012 (10:31 pm)
Okay, I changed that to this:
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)  
    {  
        if ([[UIScreen mainScreen] scale] == 2)  
            Con::setVariable("$platform", "ipad3");  
        else  
        {  
            Con::setVariable("$platform", "ipad");  
        }  
    }  
    else  
    {
        CGRect screenBounds = [[UIScreen mainScreen] bounds];
        if( screenBounds.size.height == 568)
            Con::setVariable("$platform", "iphone5");
        else if([[UIScreen mainScreen] scale] == 2)
            Con::setVariable("$platform", "iphone4");  
        else  
            Con::setVariable("$platform", "iphone");  
    }

That took care of recognizing the device. I also added the iPhone5 resolution and variable stuff everywhere that iPhone4 or iphone4 was mentioned anywhere in source. Now, the screen is shifted down, so that instead of black bars on the top and bottom I have an extra big bar at the top and no bar at the bottom. Any tips on where to go from here?
Page «Previous 1 2