Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import SpriteKit
- extension SKNode{
- func aspectScale(to size:CGSize,width: Bool,multiplier:CGFloat){
- let scale = width ? (size.width * multiplier) / self.frame.size.width :
- (size.height * multiplier) / self.frame.size.height
- self.setScale(scale)
- }
- }
Add Comment
Please, Sign In to add comment