Questions tagged [sktransition]

An SKTransition object is used to perform an animated transition between a SKScene object already presented by an SKView object and a new incoming scene.

An SKTransition object is used to perform an animated transition between a SKScene object already presented by an SKView object and a new incoming scene.

Scenes are the basic building blocks of games. Typically, you design self-contained scenes for the parts of your game, and then transition between these scenes as necessary. For example, you might create different scene classes to represent any or all of the following concepts:

  • A loading scene to display while other content is loaded

  • A main menu scene to choose what kind of game the user wants to play

  • A scene to configure the details of the specific kind of game the user chose

  • A scene that provides the gameplay

  • A scene displayed when gameplay ends

When you present a new scene in a view that is already presenting a scene, you have the option of using a transition to animate the change from the old scene to the new scene. Using a transition provides continuity so that the scene change is not quite so abrupt.

22 questions
5
votes
2 answers

SpriteKit scene transition good practices

I am writing a game using SpriteKit with Swift and have run into a memory concern. The layout of my game is such that the GameViewController (UIViewController) presents the first SKScene (levelChooserScene) in the viewDidLoad Screen. This scene…
Scooter
  • 4,068
  • 4
  • 32
  • 47
2
votes
0 answers

Sprite-Kit transition from one scene to another

I have two SKScenes which I transition in between as follows: self.skView.presentScene(scene, transition: SKTransition.fadeWithDuration(1.0)) As soon as scene-1 is faded out (after 0.5s) and the screen is black, I would like to execute some code…
salocinx
  • 3,715
  • 8
  • 61
  • 110
1
vote
1 answer

New scene view not centered after transition from the menu scene view

I created a main menu scene view after GameScene is done. GameScene worked fine by itself. However it doesn't show up in the center after it's transferred from the main menu scene view. Both sks files have the same width and height dimensions and…
Ad C
  • 25
  • 5
1
vote
0 answers

custom sktransition in SpriteKit iOS Swift

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…
Itergator
  • 299
  • 3
  • 16
1
vote
0 answers

How to present a Scene when touching the screen?

My Game is in the GameScene and Menu in my MainMenu Scene. I put the following code in the overridden touchesBegan of the MainMenu Scene to present the GameScene: let reveal = SKTransition.fade(withDuration: 0.5) let NextScene =…
Lukas
  • 451
  • 2
  • 13
1
vote
0 answers

Scene Transition fails after presenting from a different ViewController

I have a GameViewController, which transitions between different scenes, for example: CircleScene to SquareScene, back & forth with Transitions. All of the above logic works fine, as long as GameViewController is "initial view controller". Once I…
ZippyMind
  • 141
  • 2
  • 9
1
vote
1 answer

How can I wait until AdMob ad has ended to run SKScene transition?

I'm implementing AdMob ad's to my game project. I would like the ad to run first and then after the user is done watching the ad and is back to the game, I would like to run the transition. Now however the transition is being run simultaneusly with…
user594883
  • 1,329
  • 2
  • 17
  • 36
1
vote
1 answer

SKTransitions from scene to scene slow

I am writing an OS X SpriteKit app. I am transitioning from my main menu scene to the main scene, but the transition takes about 3 seconds to start. In my main scene, I have an onscreen piano that is generated programmatically. There are about 55…
02fentym
  • 1,762
  • 2
  • 16
  • 29
1
vote
2 answers

SKTransition not working in Swift

I have a very simple SpriteKit game written in Swift with two scenes that I am trying to transition between. This code works perfectly: let skView = self.view as SKView let scene = GameScene(size: self.scene.size) scene.size =…
Scooter
  • 4,068
  • 4
  • 32
  • 47
0
votes
0 answers

How to reverse SKTransition?

I have a button, that when pressed, moves to the next scene with the "doorway" transition. The doorway transition has no counterpart and opens differently when coming back. Is it possible for me to create a inverted doorway transition?
0
votes
2 answers

Expanding circle cutout transition effect in Spritekit

I am trying to get a transition effect similar to that in super mario run game by Nintendo in sprite kit I just want a circle cutout to expand revealing the next scene or just revealing the current scene. This is not available as one of the…
plawres
  • 313
  • 4
  • 19
0
votes
1 answer

How to add a song that is played over 2 of my scenes in my swift game

My final game over scene has an SKTransition back to the Main Menu. I am able to make a song play for the final game over scene, but I would like the song to continue into my Main Menu. Here is a copy of the code I have at the moment. import…
niX
  • 167
  • 8
0
votes
1 answer

How to convert Class types?

I'm trying to figure out how to convert class type so that I can go from my SKScene which is 'self' to my SCNScene which is GamePlay. And basically perform a scene normal scene transition. Code: let scene = GamePlay(coder:NSCoder()) let transition…
Hunter
  • 1,321
  • 4
  • 18
  • 34
0
votes
1 answer

How can I loop my Transition?

Okay I am fairly new to programming and am trying to create a simple game. In the background I'm having an object move from one side of the screen to another and then off the screen using SKAction and SKTransition. All I need to do is loop this…
SamCurry
  • 29
  • 4
0
votes
2 answers

'Will never be executed'

I don't know why this error appears in the code: func torpedoDidCollideWithAlien(torpedo:SKSpriteNode, alien:SKSpriteNode){ print("HIT") torpedo.removeFromParent() alien.removeFromParent() var aliensDestroyed =…
norm
  • 11
  • 2
  • 5
1
2