I am building a tower defense game with SpriteKit, and I'm relatively new to this. My map mainly consists of tiled nodes that are tangible. When the user touches the node, I can place the tower on this node (I have this part working so far). I want to move forward, instead of directly placing the tower, I would like a circular menu to appear around the node tile so that the user can select the tower that they would like to place in this node tile. If the user clicks anywhere except the circular menu, the menu should disappear.
So something like this:
http://imgur.com/QvCsM8Q
I am wondering what is the best way to do this. I have two possible solutions, but they seem to be hacked:
1) Creating a custom UIView consisting of a menu and 4 buttons, and then adding it to my scene (but then how can I detect button presses in this menu from the screen?)
2) The SKShapeNode extension to create a circle and add 4 SpriteNodes around the circle, and then check if the touch location matches one of the four SpriteNode locations.
Any suggestions / code examples, what is the best way to approach this?
source
share