title: How to Create a Cool In-depth effect for an HUD
body: <p>The picture below Is a perfect example of what im trying to do with my SKScene or SKNodes either or will satify me. </p>
  
  <p><img src="https://i.stack.imgur.com/GqmQy.jpg" alt="Click to see Picture here, Trust me it explains Alot lol"></p>
  
  <hr>
  
  <p>Ok So my first attemped at this was basicly trying to rotate the SKNode on my SKOverlayScene on the Y axis so that It can have that "indepth" affect but short after looking at all the questions about that on here i found out that its not possible to do that. So instead every one suggest to do the old card flip trick where you dont actually rotate the SKNode at all but instead change its "xScale" factor from like 1.0 to -0.0. but as you see if you try it out your self that, that is not going to give me the effect in looking for. </p>
  
  <p>This is the code for it:</p>
  
  <pre><code>    spriteNode.size = CGSize(width: 18, height: 28)
      spriteNode.position = CGPoint(x: 50, y: 10)
      spriteNode.zPosition = 0
      spriteNode.alpha = 1.0
      self.addChild(spriteNode)
  
      let action0 = SKAction.scaleX(to: 1.0, duration: 3.0)
      let action1 = SKAction.scaleX(to: -1.0, duration: 3.0)
      let action = SKAction.sequence([action0, action1])
      spriteNode.run(action)
  </code></pre>
  
  <hr>
  
  <p>This Is my attemped to try and put a UIView or a SKScene onto a SNCPlane so that i can display what i need to display for for my SKScene and then simply rotate the SCNPlane in my SCNScene so that i can cause this effect, but it failed on every aspect. I cant get the SKScene on the SCNplane to even show up and the 1 time i did, it was sized so bad in terms of aspect ratio and pixel count that it looked distorted, and i cant figure out how to get it to be transparent like png images where it doesn't show the ex's default gray background. So basiclly that options out Iguess but here the code for it. </p>
  
  <p>Code:  </p>
  
  <pre><code>class HUDPanel: UIView { //SKScene {
  
  override init(frame: CGRect) {
      super.init(frame: frame)
  
      //self.opaque = true
      self.alpha = 1.0
      self.layer.cornerRadius = 5
      self.layer.masksToBounds = true
      self.backgroundColor = UIColor.red //.clear
  
      var imageView : UIImageView
      imageView  = UIImageView(frame:CGRect(x: 0, y: 0, width: 0, height: 0))
      imageView.image = UIImage(named:"art.scnassets/DamageImage-diffuse")
      self.addSubview(imageView)
  
  
  
  }
  required init?(coder aDecoder: NSCoder) {
      fatalError("init(coder:) has not been implemented")
  }
  </code></pre>
  
  <p>// now in my SNCScene below i put:</p>
  
  <pre><code>    let HUDPlane = SCNNode()
      let HUDPlaneMaterial = SCNMaterial()
  
      HUDPlaneMaterial.diffuse.contents = HUDPanel!
      HUDPlaneMaterial.locksAmbientWithDiffuse = true
      HUDPlaneMaterial.transparency = 1.0
      HUDPlaneMaterial.isDoubleSided = true
      HUDPlaneMaterial.lightingModel = SCNMaterial.LightingModel.constant 
      HUDPlane.castsShadow = true // there are more property with shadow
      HUDPlane.geometry = SCNPlane(width: CGFloat(10.0), height: CGFloat(10.0))
      //HUDPlane.rotation = SCNVector4(x: 1, y: 0, z: 0, w: Float(-M_PI_2))
      HUDPlane.position = SCNVector3Make(UserPlayer.presentation.position.x - 6.0, UserPlayer.presentation.position.y + 20.0, UserPlayer.presentation.position.z - 20.0)
      HUDPlane.geometry!.firstMaterial = HUDPlaneMaterial
  
  
      scnView.scene!.rootNode.addChildNode(HUDPlane)
  </code></pre>
  
  <p>So basiclly Weather you show me how to do this effect with a sprite node, UIView or a SKScene preferably. To match the effect Im am attemping in the picture up top which is the HUD in-depth effect. That would be Awesome! and I'll be sure to mark it as the answer. Thanks</p>