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?
Asked
Active
Viewed 937 times
1
-
1Just use an appropriate SKNode with well chosen subnodes... – Jean-Baptiste Yunès Apr 06 '16 at 19:12
-
You need to access the View Controller and add another SKView to it. Then create a scene to go in that view the same way you did for the scene you already have running. – Wes Apr 06 '16 at 23:22
-
Did you find any answers to this problem ? – Mounika Apr 11 '17 at 15:05
2 Answers
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