title: How to display 2 labels in one scene?
body: <p>I am totally new with Swift and SpriteKit, apologies I really know nothing. I am trying to add 2 consecutive SKLabelNode in a single scene. The background of the scene is .black. I created a function that generates a SKShapeNode from a UIBezierPath to cover let's say 3/4 of the screen in a sort of P shape, .fill = .white. I add the child and end the function.</p>
  
  <p>I add the function in the <code>didMove</code> override. (Don't ask me why, I am following some examples and for the moment it seems to work. I will address this later, but at the moment I'm focused on the current problem)</p>
  
  <p>Then I create a second function to add 2 SKLabelNode. One black over the white portion and one white over the black portion. I then add both to the scene.</p>
  
  <p>I add the function after the shape one.</p>
  
  <p>The result is that the black over the white portion is not displayed.
  If I comment the white over the black, the previous is displayed without issues.</p>
  
  <p>I tried to infer the order of the <code>addChild</code> but the outcome doesn't change.</p>
  
  <p>Does anyone know the reason?</p>
  
  <p>I tried switching the <code>addChild</code>.</p>
  
  <pre><code>import SpriteKit
  
  class MenuScene: SKScene {
  
  override func didMove(to view: SKView) {
      layoutScene()
      addLabels()
  }
  
  func layoutScene() {
      backgroundColor = .black
      let rectSize = frame.size.width / 4
      //Codice per creare la scena della home
      //inizio
      let homeScreen = SKShapeNode()
      homeScreen.fillColor = .white
      let shapeHome = UIBezierPath()
      let shapeOrigin = CGPoint(x: view!.bounds.minX, y: view!.bounds.minY)
      shapeHome.move(to: shapeOrigin)
      shapeHome.addLine(to: CGPoint(x: view!.bounds.minX, y: view!.bounds.maxY))
      shapeHome.addLine(to: CGPoint(x: view!.bounds.maxX, y: view!.bounds.maxY))
      shapeHome.addLine(to: CGPoint(x: view!.bounds.maxX, y: rectSize))
      shapeHome.addLine(to: CGPoint(x: view!.bounds.maxX - rectSize, y: rectSize))
      shapeHome.addLine(to: CGPoint(x: view!.bounds.maxX - rectSize, y: view!.bounds.minY))
      shapeHome.addLine(to: CGPoint(x: view!.bounds.minX, y: view!.bounds.minY))
      shapeHome.close()
      homeScreen.path = shapeHome.cgPath
      homeScreen.fillColor = .white
      //fine
      addChild(homeScreen)
  }
  
  func addLabels() {
      let rectSize = frame.size.width / 4
      let home = SKLabelNode(text: "HOME")
      home.fontName = "AvenirNext-Bold"
      home.fontSize = 50.0
      home.fontColor = .black
      home.position = CGPoint(x: frame.midX, y: frame.midY)
      addChild(home)
  
      let b = SKLabelNode(text: "B")
      b.fontName = "AvenirNext-Bold"
      b.fontSize = 40.0
      b.fontColor = .white
      b.position = CGPoint(x: frame.maxX - (rectSize/2), y: rectSize/2)
      addChild(b)
  }
  
  override func touchesBegan(_ touches: Set&lt;UITouch&gt;, with event: UIEvent?) {
  
      }
  }
  </code></pre>