The easiest approach I can imagine is to create several images (one for each state) and finally add them to your scene (each in its correct position).
Having a separate sprite for each state will facilitate several operations, such as
- determining which state was pressed
- state color binding
- Increase condition
- apply texture to state
Image cutting
Starting with the input image that you submitted in your question, you can use an image editing tool (like Pixelmator ) with a mask function to extract images for each state.
Sprite positioning
The same image editor, after you split the images, is likely to provide you with the position of this state inside the canvas. You will need to use them to change the state inside the canvas. Or you can edit the Xcode SpriteKit scene editor to manually position the images.
source share