1

enter image description here

I know there is many question out there on the same topic but still I didn't get any idea or solution to make it work. How do I implement a small view on top of a scene with options as shown in image?

Rob
  • 14,746
  • 28
  • 47
  • 65
Pruthvi Hariharan
  • 551
  • 1
  • 6
  • 23

2 Answers2

0

You can do it within your scene using spritekit nodes or you can create a UIView from your viewController and add it the viewControllers view:

something like this:

    // set up base view of the game
    self.baseView = UIView(frame: self.view.frame)
    self.view.addSubview(self.baseView)

    // add my skView to my baseView
    self.baseView.addSubview(skView)

    // add pause button on top or other elements
    // hide or show these as needed
    self.baseView.addSubview(self.pauseBtn)
    self.addJoySticks()
hamobi
  • 7,940
  • 4
  • 35
  • 64
0

You could just use SpriteKit itself and:

scene?.view?.presentScene(anotherScene, transition: SKTransition.fadeWithDuration(1.0))

edit Just to add, If any Background AVPlayers or nodes are in play, then they're all discarded when transitioning.

Adrian Sluyters
  • 2,186
  • 1
  • 16
  • 21
  • I tried that, presentScene replaces the current scene, what I want is, just to say that you are paused and give some buttons for replay and refresh in the same scene – Pruthvi Hariharan Apr 06 '16 at 22:23