I am wondering if it is possible to include a SpriteKit scene in a SceneKit scene, and if it is, how to do that ?
First, add a new scene file to your project through Xcode's File menu > New... > File > (choose your platform tab) > SpriteKit Scene. You configure your scene in the scene editor by clicking on the .sks file in Xcode's file navigator pane, then adjusting properties in the Utility pane.
Choose the SpriteKit Scene file template, click Next, name the new file Room.sks and save it in the project’s folder. Next, set the scene’s size to be 400 x 400 pixels. Now, instead of selecting Color Sprite, select a Reference from the Object Library.
Import the SpriteKit framework, so you have access to everything it has to offer. Without it you won’t be able to have access to the SKScene class, for example, and you wouldn’t be able to create your GameScene object. Create a variable to host your GameScene object, which will be where your game is in the future.
Create a variable to host your GameScene object, which will be where your game is in the future. Use the SpriteView (scene:) view to host your GameScene object and show it in your application.
Yes there is!
You can assign a Sprite Kit scene (SKScene
) as the contents
of a material property (SCNMaterialProperty
) in Scene Kit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With