1
votes

I am using Swift and SpriteKit and I create a new circle (as a Node) like this

 var circlePlayer = SKShapeNode(circleOfRadius: 10)

and I would like to access later on the radius of the circle in order to get its value or modify it (increase it by 1 for instance) - how can I achieve this?

1
subclass skshapenode, add radius property. or just add it to the node's userData dictionary.LearnCocos2D
let radius = (circlePlayer.frame.size.width-1.0)/2.00x141E
@LearnCocos2D how do I add this property to the userData dictionary, and then access it?sachalondon

1 Answers