custom sktransition in SpriteKit iOS Swift

649 views Asked by At

I am having trouble finding documentation/examples in creating custom sktransitions between two skscenes. I can use the built in transitions fine and plan to use some of those.

Can somebody explain the process in creating a transition, possibly with an example?

I am getting a bit confused as I see examples with CIFilters and alike. I understand these are from the CoreImage framework, so am wondering how these are involved.

Many thanks.

Leon

Edit 1:

I have tried a Swift 3 version such as:

let customFilter = CIFilter(name: "CIDotScreen")
let transition = SKTransition(ciFilter: customFilter!, duration: 0.5)
let newScene = GameOverScene(size: self.size, won: false)
transition.pausesOutgoingScene = true
self.view?.presentScene(newScene, transition: transition)

from Custom SKTransitions

and using SKTransition.init(ciFilter:, duration:) - the same initialiser as above, but the transition doesn't animate. Interestingly, the transition back to the main game screen, a built in flip animation, doesn't start until after the duration specified above has expired.

0

There are 0 answers