TextureAtlas工具不读书的纹理地图 - SpriteKit纹理地图生成器错误 [英] TextureAtlas tool not reading Texture atlas - SpriteKit Texture Atlas Generator Error

查看:190
本文介绍了TextureAtlas工具不读书的纹理地图 - SpriteKit纹理地图生成器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做一个简单的动画一个节点,所以我创建了每一帧为.png文件中的动画,我坚持他们的所有文件夹中,并把它命名为stoneanimation2.atlas。

I am trying to make a node with a simple animation, so I created a animation with each individual frame as a .png file, I stuck them all in a folder, and named it stoneanimation2.atlas .

这是code我尝试:

SKTextureAtlas *atlas = [SKTextureAtlas atlasNamed:@"stoneanimation2"];


    SKTexture *stone2 = [atlas textureNamed:@"stone2.png"];
    SKTexture *stone3 = [atlas textureNamed:@"stone3.png"];
    SKTexture *stone4 = [atlas textureNamed:@"stone4.png"];
    SKTexture *stone5 = [atlas textureNamed:@"stone5.png"];
    SKTexture *stone6 = [atlas textureNamed:@"stone6.png"];
    SKTexture *stone7 = [atlas textureNamed:@"stone7.png"];
    SKTexture *stone8 = [atlas textureNamed:@"stone8.png"];
    SKTexture *stone9 = [atlas textureNamed:@"stone9.png"];
    SKTexture *stone10 = [atlas textureNamed:@"stone10.png"];
    SKTexture *stone11 = [atlas textureNamed:@"stone11.png"];
    SKTexture *stone12 = [atlas textureNamed:@"stone12.png"];
    SKTexture *stone13 = [atlas textureNamed:@"stone13.png"];
    SKTexture *stone14 = [atlas textureNamed:@"stone14.png"];
    SKTexture *stone15 = [atlas textureNamed:@"stone15.png"];
    SKTexture *stone16 = [atlas textureNamed:@"stone16.png"];
    SKTexture *stone17 = [atlas textureNamed:@"stone17.png"];
    SKTexture *stone18 = [atlas textureNamed:@"stone18.png"];
    SKTexture *stone20 = [atlas textureNamed:@"stone20.png"];
    SKTexture *stone21 = [atlas textureNamed:@"stone21.png"];
    SKTexture *stone22 = [atlas textureNamed:@"stone22.png"];
    SKTexture *stone23 = [atlas textureNamed:@"stone23.png"];
    SKTexture *stone24 = [atlas textureNamed:@"stone24.png"];
    SKTexture *stone25 = [atlas textureNamed:@"stone25.png"];
    SKTexture *stone26 = [atlas textureNamed:@"stone26.png"];
    SKTexture *stone27 = [atlas textureNamed:@"stone27.png"];
    SKTexture *stone28 = [atlas textureNamed:@"stone28.png"];

    NSArray *atlasTexture = @[stone2,stone3,stone4,stone5,stone6,stone7,stone8,stone9,stone10,stone11,stone12,stone13,stone14,stone15,stone16,stone17,stone18,stone20,stone21,stone22,stone23,stone24,stone25,stone26,stone27,stone28];

    stoneAnimation = [SKAction animateWithTextures:atlasTexture timePerFrame:.01];

它的工作之前,我只有约10幅。但我决定添加更多的,我认为这事搞砸了寰本身,因为X $ C $ç说:SpriteKit纹理图集生成错误,这是错误消息:

It worked before, when I only had about 10 frames. But I decided to add more, and I think it messed something up with the atlas itself, because Xcode says "SpriteKit Texture Atlas Generator Error" This is the error message:

Command /Applications/Xcode.app/Contents/Developer/Tools/../usr/bin/TextureAtlas failed with exit code 11

每一次,我完全做一个新的地图,或者只是将其重命名,看看有没有什么工作,我得到了同样的错误。此外,在建的设置,我有启用阿特拉斯生成器设置为YES。我试图在CH375复位的IOS模拟器,和一切我能想到的!请帮助!

Every time that I completely make a new atlas, or just rename it, to see if that works, I get the same error. Also, in build settings, I have "Enable Atlas Generator" set to "YES". And I have tried reseting the IOS simulator, and everything I can think of! Please Help!

推荐答案

我想通了,我的问题是,纹理地图不正确的进口,我想这是因为我之前正确导入,然后改变它。所以我有一个?在项目导航纹理地图。我不需要改变任何code,我所做的就是右键点击纹理地图,然后点击:源代码控制>添加选定的文件。

I figured out that my problem was that the texture atlas was not imported correctly, I think it was because I imported it before correctly and then changed it. So I got a ? by the texture atlas in the project navigator. I didn't need to change any code, all I did was right click the texture atlas and click: source control > add selected file.

这无关我的code

这篇关于TextureAtlas工具不读书的纹理地图 - SpriteKit纹理地图生成器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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