Hi all.
I can determine the screen Size by:
but maybe because I eyeballed the placement of the Bitmaps
if I multiply the currentX * scalerX it's off also
tried
What am I doing wrong? Is the original iphone resolution not 320 X 480??
what should I scale by??
thanks
Ian
I can determine the screen Size by:
Code:
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){
if ([UIScreen mainScreen].scale == 2.0f) {
CGSize result = [[UIScreen mainScreen] bounds].size;
CGFloat scale = [UIScreen mainScreen].scale;
result = CGSizeMake(result.width * scale, result.height * scale);
scalerX=1;
scalerY=1;
NSLog(@"Screen is X:%f Y:%f",scalerX,scalerY);
if(result.height == 960){
NSLog(@"iPhone 4, 4s Retina Resolution");
}
if(result.height == 1136){
NSLog(@"iPhone 5 Resolution");
}
} else {
NSLog(@"iPhone Standard Resolution");
CGSize result = [[UIScreen mainScreen] bounds].size;
CGFloat scale = [UIScreen mainScreen].scale;
result = CGSizeMake(result.width * scale, result.height * scale);
scalerX=1;
scalerY=1;
NSLog(@"Screen is X:%f Y:%f",scalerX,scalerY);
}
} else {
CGSize result = [[UIScreen mainScreen] bounds].size;
CGFloat scale = [UIScreen mainScreen].scale;
result = CGSizeMake(result.width * scale, result.height * scale);
if ([UIScreen mainScreen].scale == 2.0f) {
NSLog(@"iPad Retina Resolution");
} else{
NSLog(@"iPad Standard Resolution");
}
scalerX=2.0; <--- why does this work better ??
scalerY=2.0;
// tried ratio of 326/163 which is 2 anyway.
NSLog(@"Screen is X:%f Y:%f",scalerX,scalerY);
}
but maybe because I eyeballed the placement of the Bitmaps
if I multiply the currentX * scalerX it's off also
tried
Code:
positionX =currentX * scalerX
// also tried this .. both are off for ipad //
positionX = currentX*(result.width/320);
What am I doing wrong? Is the original iphone resolution not 320 X 480??
what should I scale by??
thanks
Ian