How to make my sprite kit scene appear above a UIView?

后端 未结 1 1179
梦如初夏
梦如初夏 2020-12-19 11:30

I\'ve done some searching but haven\'t found anything directly addressing my issue: I have an SKScene with several SKNodes each with SKSprite

相关标签:
1条回答
  • 2020-12-19 11:39

    Your problem is here that you are directly setting SKView as a controller view. To overcome from this issue don't make self.view a type of SKView. Do the following step in your storyboard or Xib :

    1. Add an UIImageView on the controller's view first. Set the image as well.
    2. Then add a SKView over the UIImageViewand set UIClearColor to the background colour.

    So the complete hierarchy is like UIViewController->UIView->UIImageView->SKView

    0 讨论(0)
提交回复
热议问题