I created an image for retina resolution for 4 inch screen with the size of 640x1136px. It didn't scale properly. To debug, I decided to let the code print out the width and height of self.view.frame. The results were
width: 320
height: 480
this is incorrect as height should be 568 points (1136 px). What is the deal with wrong frame size in objective-c spriteKit?
Edit:
Code posted below
Below @implementation
UIImageView* menuImage;
in (void)didMoveToView:(SKView *)view
menuImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"menuImage"]];
menuImage.frame = self.view.frame;
NSLog(@"height: %f || width: %f", self.view.frame.size.height, self.view.frame.size.width);
Edit 2:
submitting the results of few tests
ScreenSize: {{0, 0}, {320, 480}}
SuperViewSize: {{0, 0}, {0, 0}}
SelfSize: {{0, 0}, {320, 480}}
NSLogstatements and post their values?NSLog(@"ScreenSize: %@", NSStringFromCGRect([[UIScreen mainScreen] bounds]));NSLog(@"SuperViewSize: %@", NSStringFromCGRect(self.view.superview.bounds));NSLog(@"SelfSize: %@", NSStringFromCGRect(self.view.bounds));- AMI289