SKLightNode无法在真实设备上运行[iPhone 5] [英] SKLightNode not working on real device [iPhone 5]

查看:159
本文介绍了SKLightNode无法在真实设备上运行[iPhone 5]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了一个简约的项目这里一个红色的正方形 - 在点击屏幕后 - 点亮一个光源。在模拟器上运行正常,但是在我的iPhone 5上,只要光源被添加到节点树中,方块就会变得不可见。

I've set up a minimalistic project here which simply adds a red square and - after tapping the screen - a light source lighting it. On simulator it runs fine, but on my iPhone 5 the square just becomes invisible as soon as the light source gets added to the node tree.

任何人都可以在其他地方测试这个,真实设备并提供反馈?有解决方案?这让我发疯了。

Can anyone test this on other, real devices and give feedback? Any solutions? It's driving me crazy.

这是场景的代码:

SKLightNode* lightNode;

@implementation GameScene

-(void)didMoveToView:(SKView *)view {
    //Add some node to be lit
    SKSpriteNode* node = [SKSpriteNode spriteNodeWithColor:[UIColor redColor] size:CGSizeMake(100, 100)];
    node.position = CGPointMake(self.size.width/2.0, self.size.height/2.0);
    node.lightingBitMask = 1;
    [self addChild:node];
}

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    //Add a light node to light the object
    if (!lightNode) {
        lightNode = [SKLightNode node];
        lightNode.categoryBitMask = 1;
        [self addChild:lightNode];
    }
    lightNode.position = [((UITouch*)[touches anyObject]) locationInNode:self];
}

- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    lightNode.position = [((UITouch*)[touches anyObject]) locationInNode:self];
}

@end


推荐答案

iOS8中似乎存在错误。我遇到了同样的问题,并向Apple发送了一个bug报告。
SKLightNode似乎在iPhone5上运行不佳。我试过iPhone6(ok),iPhone5s(ok),iPhone5(不工作 - 黑屏),iPod5(ok),iPad Mini Retina(ok),ipad2(ok)。

There seems to be a bug in iOS8. I've experienced the same problem and sent a bugreport to Apple. SKLightNode does not seems to work well on an iPhone5. I've tried on iPhone6 (ok), iPhone5s (ok), iPhone5 (not working - black screen), iPod5 (ok), iPad Mini Retina (ok), ipad2 (ok).

这篇关于SKLightNode无法在真实设备上运行[iPhone 5]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆