简体   繁体   English

SpriteKit和UIViewController

[英]SpriteKit and UIViewController

Does the SpriteKitView have to be set to the view property of the UIViewController . 是否必须将SpriteKitView设置为UIViewController的view属性。 Is it not possible to add it to a view within a nested UIViewController ? 是否无法将其添加到嵌套UIViewController的视图中?

Whenever I try this it does not appear however the SpriteKitScene is running as messages output to the console informing that updates are occurring within the nodes of the scene. 每当我尝试这一点时,它不会出现,但SpriteKitScene正在作为消息输出到控制台运行,通知更新正在场景的节点内发生。

Do you mean like this (see image below)? 你的意思是这样的(见下图)?

SKView inherits from UIView so, like any other view, it is possible to combine it with other views in the view hierarchy. SKView继承自UIView,因此,与任何其他视图一样,可以将其与视图层次结构中的其他视图组合。

If your SKScene is created but not appearing, maybe you forgot to call presentScene for your scene? 如果您的SKScene已创建但未显示,可能您忘记为您的场景调用presentScene?

SKView小时候

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM