Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions SKTUtils/SKNode+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down