Guest User

Untitled

a guest
Apr 22nd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. import SpriteKit
  2.  
  3. extension SKNode{
  4. func aspectScale(to size:CGSize,width: Bool,multiplier:CGFloat){
  5. let scale = width ? (size.width * multiplier) / self.frame.size.width :
  6. (size.height * multiplier) / self.frame.size.height
  7. self.setScale(scale)
  8.  
  9. }
  10. }
Add Comment
Please, Sign In to add comment