diff --git a/SKTUtils/SKNode+Extensions.swift b/SKTUtils/SKNode+Extensions.swift index ee76ed9..c1fa86f 100644 --- a/SKTUtils/SKNode+Extensions.swift +++ b/SKTUtils/SKNode+Extensions.swift @@ -35,6 +35,17 @@ public extension SKNode { } } + /** Lets you treat the node's scale as a CGSize value */ + public var scaleAsSize: CGSize { + get { + return frame.size + } + set { + xScale = newValue.width/frame.size.width + yScale = newValue.height/frame.size.height + } + } + /** * Runs an action on the node that performs a closure or function after * a given time.