Hi. For the past few days, I have been trying to create an SKShapeNode (a rectangle) that will be used as a menu screen moving down from the outside of the screen when a button is tapped. Everything behind the node should be blurred.
Something to this effect: https://stackoverflow.com/questions/49142867/spritekit-blurred-background-sknode
Alternatively, I may have everything in the background blurred with the exception of the SKShapeNode and its children.
let blur = CIFilter(name:"CIGaussianBlur",withInputParameters: ["inputRadius": 10.0]) self.filter = blur self.shouldRasterize = true self.shouldEnableEffects = true menu.run(moveMenuDown)
where self is the scene, blurs the background and the SKShapeNode. Besides, it is an awful hit on FPS.
I tried the following:
let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.light) let blurEffectView = UIVisualEffectView(effect: blurEffect) blurEffectView.frame = self.view!.bounds blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight] self.view!.addSubview(blurEffectView)
This is very fast, but again this blurs everything including the SKShapeNode, which is not intended.
Is there anyone who did something like that?
Thanks a lot!