What's the difference between SKView and SKScene

后端 未结 1 480
鱼传尺愫
鱼传尺愫 2020-12-31 19:35

From the Apple Docs..

SKView: \"An SKView object is a view that displays Sprite Kit content. This content is provided by an SKScene object.\"

SKSCene: \"An

1条回答
  •  被撕碎了的回忆
    2020-12-31 19:59

    The SKView is a UIView subclass. It wraps up Sprite Kit content in a view that can be used like any other Cocoa view. It usually has an associated view controller. That's Sprite Kit's connection with the Cocoa world.

    The scene is the root object of the scene graph. It provides callbacks (physics, scene change, update) needed to implement a game. It does not concern itself with anything Cocoa related.

    Normally the view remains as is while you can present scenes to swap out game content, for example moving from the menu to the game scene. Internally the view also caches resource files in memory, so as you switch scenes they don't have to reload the same textures.

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