如何在屏幕上同时显示2个场景

时间:2021-09-14 10:40:28

How can I show 2 scenes on the screen at the same time on Sprite Kit Swift?
I need to first scene be placed of the second (I need one scene to be seen and atop of it appeared other scene, which has some sprites).
Or tell me, how developers make, for example, menu (with buttons like "restart", "results") to appear on other scene when player dies? And that time, also you can see the main scene with location (or with dead character)?

如何在Sprite Kit Swift上同时在屏幕上显示2个场景?我需要首先放置第二个场景(我需要一个场景才能看到,并且它的顶部出现了其他场景,其中有一些精灵)。或者告诉我,开发者如何制作,例如,菜单(带有“重启”,“结果”等按钮)在玩家死亡时出现在其他场景中?那个时候,你也可以看到主场景的位置(或死角)?

1 个解决方案

#1


0  

You do not need 2 scenes. However, you can accomplish what you are after with basing an node tree off of an SKNode. For your menu idea you could build it out of however many objects you'd like, but since it is based from an SKNode, you can animate it to your hearts content. No need for two scene, just build another node tree and animate the root. If that isn't enough answer, I could write some code to help you out if need be. Sorry watching the Netflix and feeling lazy.

你不需要2个场景。但是,您可以通过基于SKNode的节点树来完成您的工作。对于您的菜单创意,您可以使用您想要的许多对象来构建它,但由于它基于SKNode,因此您可以根据自己的心灵内容对其进行动画处理。不需要两个场景,只需构建另一个节点树并为根设置动画。如果这还不够,我可以写一些代码来帮助你,如果需要的话。很抱歉看着Netflix,感觉很懒。

#1


0  

You do not need 2 scenes. However, you can accomplish what you are after with basing an node tree off of an SKNode. For your menu idea you could build it out of however many objects you'd like, but since it is based from an SKNode, you can animate it to your hearts content. No need for two scene, just build another node tree and animate the root. If that isn't enough answer, I could write some code to help you out if need be. Sorry watching the Netflix and feeling lazy.

你不需要2个场景。但是,您可以通过基于SKNode的节点树来完成您的工作。对于您的菜单创意,您可以使用您想要的许多对象来构建它,但由于它基于SKNode,因此您可以根据自己的心灵内容对其进行动画处理。不需要两个场景,只需构建另一个节点树并为根设置动画。如果这还不够,我可以写一些代码来帮助你,如果需要的话。很抱歉看着Netflix,感觉很懒。