how can i make a pop up menu in sprite kit swift? [closed]

纵饮孤独 提交于 2019-12-13 10:13:06

问题


I'm trying to make a pop up menu for a game, what's the best way to make it? it looks like this:


回答1:


I'll give you a high level explanation

Just create a new sknode or skspritenode with zPosition of 50 or something so its above everything else, and have child nodes in it for buttons, etc. Each node can have a touches began/ touches ended event so you can detect touches.

also don't forget to set:

self.userInteractionEnabled = true

and then each button (node) can have a texture for what you want the button to look like.

then on clicking the menu button, you can add this menu node to the parent node (the SKScene presumably)



来源:https://stackoverflow.com/questions/33241283/how-can-i-make-a-pop-up-menu-in-sprite-kit-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!