ios - UIVisualEffectView doesn't blur it's SKView superview -


I am writing a spritekit game and facing a problem with a blurred view, which is on SKVU. This game is supposed to slide right when it is stopped and it should blur the contents of the parent's view (SKVUE) like Control Center panel in iOS 7. This is the desired appearance:

Enter image details here

What exactly do I get:

Enter image details here

< P> In fact, the view is not completely black on the left, you can see how highlights from the supervision are struggling through a slightly opaque review, but no stigma has been applied. Is this an iOS 8 bug / feature, or is it my mistake / misconception

Here are my universal effects subclasses:

  class optionsView: UIVisualEffectView {// ... Init (Size: CGSize) {button = [UIButton] () super.init (effect: UIBlurEffect (style: dark)) frame = seagrakemake (-based width, 0, size.wind, size.heat) AddButtons () clipsToBounds = true} function show () {UIView.animateWithDuration (0.3, animation: {self.frame.origin.x = 0})} Hide the function () {UIView.animateWithDuration (0.3, Animation: {self.frame .origin .x = -self.frame.size.width})}  

then gam In the eScene class:

In the initializer:

  optionsView = OptionsView (size: CGSizeMake (130, size.height))  

In the didMoveToView (see: SKView):

  view.addSubview (optionsView)  

by pressing the stop button:

  self .o PtionsView.show ()  

P.S. Although I know two other methods of implementing Blur View, I think it was the easiest because my app only supports iOS 8

  1. Blurred with supervision Presenting static images -> UIImageView on optionsView words, true with clipsToBounds =>> animate UIImageView position while animating optionsView position, so that the blur still remains a relatively superview

  2. Forget about UIView, UIVisualEffectView and UIBlurView and to SKEffectNode Use along with SKCropNode.

OK, I want to use the SKEffectNode instead of UIVisualEffectView Here is the code for the person experiencing the same problem

  class blurcropNode: SKCropNode {var blurNode: BlurNode var Size: CGSize init (Size: CGSize) {self.size = Size BlurNode = BlurNode: 10) go to super.init () addChild (blurNode) mask = SKSpriteNode (Color: UIColor.blackColor (), Size: size) mask.anchorPoint = CGPoint.zeroPoint maskNode = mask}} class BlurNode: SKEffectNode {var Sprite: Texture on SKSpriteNode :. SKTexture {{Get return sprite.texture} set {sprite.texture = newValue go scale = UIScreen.mainScreen () scale textureSize = newValue.size () sprite.size = CGSizeMake (textureSize.width / scale, textureSize .height / scale )}} Init (radius: CGFloat) {sprite = SKSpriteNode () super.init () sprite.anchorPoint = CGPointMake (0, 0) addChild (sprite) filter = CIFilter (na I: "CIGaussianBlur", with InputPatameters: [ "Inputridius": Radius]) should enableEffects = true shouldRasterize = true}}  

result:

Although there are many issues

  1. with crop SKEffectNode It does not work until it should not be rasterize property is set to true. I have full screen blurred, so I still do not know how to implement real time blur properly.

  2. Animation is not easy on the blurcopynode, initially there is an interval because capturing the texture and setting it into a node's son of a son even sending / noncommercial does not help is.

It would be greatly appreciated that anyone can help solve at least one problem


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -