How to make a scene with a set of sprites above the UIView?

I did some searches, but did not find anything directly addressing my problem: I have SKScenewith several SKNodes, each of which has objects SKSpriteNodefor my game, and I use the background UIImageView(there are some things that I need to do with a background that cannot be reasonable, made using a set of sprites - as far as I know); The problem I am facing is that it UIImageViewappears above everything and I do not see my game objects.

In my opinion, the controller (.m file) I have the following code to call my scene

@implementation GameViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    SKView * skView = (SKView *)self.view;

     SKScene * scene = [GameScene sceneWithSize:skView.bounds.size];
    scene.scaleMode = SKSceneScaleModeAspectFill;
    [skView presentScene:scene];

}

GameScene , SKNodes, (, nodeHDU, nodePlay, nodePauseMenu...), UIImageView ( , UIViewAnimationOptionTransitionCrossDissolve; SKSpriteNode SKSpriteNodes SKActions UIImageView)

UIView *backgrounds = [[UIView alloc] init];
[self.view insertSubview:backgrounds belowSubview:self.view];

UIImageView *imageBackground = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height)];
[backgrounds addSubview:imageBackground];
[backgrounds sendSubviewToBack:imageBackground];
[imageBackground setImage:[UIImage imageNamed:@"1-A.png"]];
imageBackground.alpha=1.0;

, ImageBackground - , Xcode. ( ) , NSLog , , , ImageBackground, . "belowSubview" "sendSubviewToBack" .

, ImageBackground ?

+4
1

, SKView . , self.view SKView. Xib:

  • UIImageView . .
  • SKView UIImageView UIClearColor .

, UIViewControllerUIViewUIImageViewSKView

+2

All Articles