Kyl*_*cot 12 objective-c ios ios7 sprite-kit skview
我有一个问题,我的SKView的背景颜色(灰色)在场景出现之前被短暂显示.
我通过Storyboard编辑器和我的控制器(self.skView.backgroundColor = [SKColor blueColor])手动尝试设置它,但它仍然是灰色的.这不是可以覆盖的属性吗?
更新#1
这里有一些关于发生了什么的解释:
viewDidLoad被调用并skView在屏幕上显示灰色背景(skView.scene尚未设置).视图控制器
- (void)viewDidLoad
{
[self.activityIndicator startAnimating];
[self authenticatePlayer];
self.skView.backgroundColor = [SKColor blueColor];
// During this time the grey screen is visible as the assets are being loaded and take ~1 second
// self.skView.scene is NULL here so I cannot set the backgroundColor...
[GamePlayScene loadSceneAssetsWithCompletionHandler:^{
[self.activityIndicator stopAnimating];
self.activityIndicator.hidden = YES;
CGSize viewSize = self.skView.bounds.size;
self.gamePlayScene = [[GamePlayScene alloc] initWithSize:viewSize];
self.adView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[self.skView presentScene:self.gamePlayScene];
}];
...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5155 次 |
| 最近记录: |