0
votes

I have spent 1000's of hours into one of my games and just started looking at iPad stuff. Yeah... didn't realize what the whole CGSize size = [[CCDirector sharedDirector] winSize]; thing was until now.

So I'm pretty much screwed right? There's no sense in changing literally 10,000 ccp coordinates?

Is there a way:

if iPad add or subtract to the ccp to position to put everything in the center

I could add it to every scene.

2

2 Answers

0
votes

Yes no worries. I believe you just need to change your assets and just define:

float deviceScale

And you can easily check in your appDelegate, what device is the program running on:

NSString *deviceType = [UIDevice currentDevice].model;
NSLog(@"deive name is %@",deviceType);

if([deviceType isEqualToString:@"iPad"] || [deviceType isEqualToString:@"iPad Simulator"] ){
        [[CCDirector sharedDirector] setContentScaleFactor:1];
} else {
    if([[UIScreen mainScreen] respondsToSelector:NSSelectorFromString(@"scale")])
    {
        if ([[UIScreen mainScreen] scale] < 1.1){
            [[CCDirector sharedDirector] setContentScaleFactor:1];
        }   
        if ([[UIScreen mainScreen] scale] > 1.9){
                        //retina display
            [[CCDirector sharedDirector] setContentScaleFactor:2];
        }
    }
    else {
        [[CCDirector sharedDirector] setContentScaleFactor:1];
    }   
}

As I said before you might need to have a variable 'deviceScale', for retina/ ipad make it deviceScale = 1 for all others deviceScale = 0.5. Then scale down the images if device is non retina or not ipad.

-1
votes

I hope your app is using version 0.99.5. 0.99.5 is using by pixels or something.. So you wont b screwed. It will auto scale by ratio.. No worries..