Making a SKScene's background transparent not working… is this a bug?

前端 未结 5 734
挽巷
挽巷 2020-12-03 06:52

Is there a way to make a SKScene\'s background transparent and present that scene over another one seeing thru the transparency.

The idea is to have the background o

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-03 07:19

    Transparency works only for iOS 8, have to check for iOS 7

    In the ViewController set transparency as :

    SKView *skView = (SKView *)self.mySKView;
    SKScene *skScene = [MyScene sceneWithSize:skView.bounds.size];
    skScene.scaleMode = SKSceneScaleModeAspectFill;
    skView.allowsTransparency = YES;
    [skView presentScene: skScene];
    

    In MyScene.m set background as clear color:

    self.scene.backgroundColor = [UIColor clearColor];

提交回复
热议问题