Skip to content

Coder-ACJHP/SKPulsator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SKPulsator

Circle pulse animation for SKSpriteNode as extension



How to use?

  • Add SKPulsator.swift file to your project
  • Call the addPulseEffect() function by adding . after your SKSpriteNode name

Example usage :


import SpriteKit
import GameplayKit

class GameScene: SKScene {

private var pulseNode: SKSpriteNode!

override func didMove(to view: SKView) {
    
    self.backgroundColor = .white
    if let node = self.childNode(withName: "anyNode") as? SKSpriteNode {
        self.pulseNode = node
    }
    
}

override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
    self.pulseNode.repeatPulseEffectForEver(circleOfRadius: 80)
    
    //self.pulseNode.addPulseEffect(circleOfRadius: 80, backgroundColor: .red)

}

}

And here is UIKit version (lightweight)

License : GNU GENERAL PUBLIC LICENSE V3

Releases

No releases published

Packages

No packages published

Languages