I am creating a game in SpriteKit and having trouble using background images in my game. I think the problem is that the image has to be the exact resolution of the device otherwise it won't show up. My game is universal so I need it to work with all devices and screen sizes. The way it is now the background shows up black on every device except a normal resolution iPad. I believe this is because that is the resolution of the image. So I want to add on an image that is the resolution of an iPhone but i don't know how to name it so that it would work. How would I go about this? Thanks!
- (void)didMoveToView:(SKView *)view
{
if (!self.contentCreated)
{
[self createSceneContents];
self.contentCreated = YES;
}
}
- (void)createSceneContents
{
self.backgroundColor = [SKColor whiteColor];
self.scaleMode = SKSceneScaleModeAspectFill;
SKSpriteNode *bgImage = [SKSpriteNode spriteNodeWithImageNamed:@"bg"];
[bgImage setAnchorPoint:CGPointZero];
[self addChild:bgImage];
}
For some reason it only works on a non retina iPad the screen shows up black on all others