I have a standard SpriteKit hierarchy: my UIViewController contains a SKView, which is presenting my SKScene. I want to be able to blur everything out when pausing my scene, so I'm adding a UIVisualEffectView with a UIBlurEffect as a subview of my SKView. This applies the lightness/darkness part of the UIBlurEffect (so I know I'm setting the frame properly), but fails to actually blur any of the nodes in my scene. iOS 8 bug, or developer error?
Asked
Active
Viewed 486 times
0
-
1use the scene's effectNode – CodeSmile Jul 01 '14 at 17:33
-
This is the same question as http://stackoverflow.com/questions/22490818/how-do-i-blur-a-scene-in-spritekit – LightMan Mar 10 '15 at 10:49
1 Answers
0
I found a way to do this. When you initialize your scene, in your GameViewVontroller, pass your skView along. Then in your GameScene.swift you can do it as follows:
var visualEffectView = UIVisualEffectView(effect: UIBlurEffect(style: .Dark)) as UIVisualEffectView
visualEffectView.frame = myView.bounds
myView.addSubview(visualEffectView)