Reputation: 160
I have created various SKSPriteNode's in a scene. The node is circle. I was wondering how I would be able to change the node's size to maybe 2/3's or 3/4's of it's original size depending on a condition I have. I know I have to use the scale method/function but i'm not 100% sure how I would implement 2/3's or 3/4's of it's current size into the parameters :/
Upvotes: 1
Views: 595
Reputation: 160
Method/Function as such:
func scalePlayer(percentage: CGFloat)
{
player.xScale = percentage
player.yScale = percentage
}
then implement during condition as such:
scalePlayer(percentage: 0.75)
Upvotes: 1