How do I resize a SKShapeNode?
What I've tried so far:
Frame resize
box.frame.width = 10
Gives the error Cannot assign to the result of this expression
SKAction
let actionResize = SKAction.resizeToWidth(10, duration: NSTimeInterval(0.1))
box.runAction(actionResize)
Nothing happens
xScale
box.xScale = 0.1
Scales the node instead of resizing
Change it to a var:
The action,
resizeToWidth
, can be called by an SKSpriteNode.You can call the action,
scaleTo
, with SKShapeNode.