SpriteKit not respecting zPosition?

后端 未结 2 1965
情深已故
情深已故 2020-12-11 03:23

What effect addChild and zPosition really have on a scene?

I mean this: suppose I do this

sprite1.zPosition = 50;
sprite2.zPosition = 10;
sprite3.zPo         


        
2条回答
  •  长情又很酷
    2020-12-11 04:23

    In your game view controller, set the ignoresSiblingOrder property to false (or NO in objective-C).

    let skView = self.view as SKView
    skView.ignoresSiblingOrder = false
    

提交回复
热议问题