由于某些奇怪的原因,我的纹理图集中的纹理没有加载。我不知道为什么。
下面是我通常如何声明/编码纹理
-(SKSpriteNode *)background {
SKSpriteNode *background;
NSArray *backgroundIpad;
background = [SKSpriteNode spriteNodeWithImageNamed:@"dodgR - main background"];
background.position = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame));
background.size = CGSizeMake(1136, 640);
NSArray *backgroundIphone = @[[SKTexture textureWithImageNamed:@"dodgR - animation 1.jpg"],
[SKTexture textureWithImageNamed:@"dodgR - animation 2.jpg"],
[SKTexture textureWithImageNamed:@"dodgR - animation 3.jpg"],
[SKTexture textureWithImageNamed:@"dodgR - animation 4.jpg"],
[SKTexture textureWithImageNamed:@"dodgR - animation 5.jpg"],
[SKTexture textureWithImageNamed:@"dodgR - animation 6.jpg"],
[SKTexture textureWithImageNamed:@"dodgR - animation 7.jpg"],
[SKTexture textureWithImageNamed:@"dodgR - animation 8.jpg"],
[SKTexture textureWithImageNamed:@"dodgR - animation 9.jpg"],
[SKTexture textureWithImageNamed:@"dodgR - animation 10.jpg"]];
SKAction *backgroundIphoneAnimation = [SKAction animateWithTextures:backgroundIphone timePerFrame:0.05];
SKAction *backgroundIphoneRepeat = [SKAction repeatActionForever:backgroundIphoneAnimation];
[background runAction:backgroundIphoneRepeat];
background.name = @"background";
return background;
}
我的纹理图集的名称是 sprites.atlas 任何帮助将不胜感激,谢谢