Animation Error

Hello,


i have been developing a SpriteKit game using the .sks files and the TileMaps. When i do a transition between 2 scenes the transition does not appear, but the scene suddenly change after some seconds. During that, this message appears in console: <Error>: CGBitmapContextCreateImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.


What does it mean? How can i fix that?


Best Regards.

Replies

I have a feeling those two things are unrelated. I'm thinking your transition is actually working, but something in the definition of the transition is causing the behavior of just cutting from scene to scene. Maybe you can post the transition code here and we'll take a look.


As for your console error, it seems it's a known bug in Xcode and can be disregarded. Read more here: https://forums.developer.apple.com/thread/13683

Thanks for your reply. I will show to you the code of the transition:


let gameScene = GameScene6(fileNamed: "GameScene6")
            gameScene?.scaleMode = .aspectFill
            let transition = SKTransition.fade(with: UIColor.black, duration: 1.0)
            self.scene?.view?.presentScene(gameScene!, transition: transition)


Note that i build my scenes by using the .sks files. In other projects (withouth .sks files) the transition worked good.

It looks correct, so I don't really have an idea what's up. Is the second scene really heavy to load? Maybe you should test it out with different source and target scenes and see which ones cause issues and which don't.