Jesse Onolemen
Jesse Onolemen

Reputation: 1325

How To Implement Loading Screen

I was wondering how can I implement a loading screen in my game. I have seen it in many popular games and I would like to add one. It's not just for fun but I have seen some slow loading times between scenes and would just like to add a smooth touch to the user experience instead of them thinking that their iDevice crashed.

Upvotes: 0

Views: 1299

Answers (1)

Christian
Christian

Reputation: 22343

You can use SKTransition for that:

var transition = SKTransition.fadeWithDuration(5)
self.view?.presentScene(yourScene, transition: transition)

This code fades out your old scene and smoothly loads the new one. There are many different options available you could use instead of fadeWithDuration:

crossFadeWithDuration(_:)
doorsCloseHorizontalWithDuration(_:)
doorsCloseVerticalWithDuration(_:)
doorsOpenHorizontalWithDuration(_:)
doorsOpenVerticalWithDuration(_:)
doorwayWithDuration(_:)
fadeWithColor(_:duration:)
flipHorizontalWithDuration(_:)
flipVerticalWithDuration(_:)
moveInWithDirection(_:duration:)
pushWithDirection(_:duration:)
revealWithDirection(_:duration:)
init(CIFilter:duration:)

Upvotes: 3

Related Questions