This is sort of a stupid question, but what does the function self.addChild()
do?
I am familiar with this function, and how to use it, but I am not exactly sure what it adds the child to.
For instance, I have created and designed an SKShapeNode
called spinnyNode
. Then I call the function:
func touchDown(atPoint pos : CGPoint) {
if let n = self.spinnyNode?.copy() as! SKShapeNode? {
n.position = pos
n.strokeColor = SKColor.black
self.addChild(n)
}
What is the parent in this situation? Is it the view that the node is being created in?
Thank you so much for your time, and your answering of stupid questions.