gpt4 book ai didi

ios - TextureAtlas 工具不读取纹理图集 - SpriteKit 纹理图集生成器错误

转载 作者:行者123 更新时间:2023-11-29 10:46:24 24 4
gpt4 key购买 nike

我正在尝试制作一个带有简单动画的节点,因此我创建了一个动画,其中每个单独的帧都作为 .png 文件,我将它们全部放在一个文件夹中,并将其命名为 stoneanimation2.atlas 。

这是我试过的代码:

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 帧。但我决定添加更多,我认为它搞砸了图集本身,因为 Xcode 说“SpriteKit Texture Atlas Generator Error”这是错误消息:

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

每次我完全制作一个新的 map 集,或者只是重命名它,看看它是否有效,我都会得到同样的错误。此外,在build设置中,我将“启用 Atlas 生成器”设置为"is"。而且我试过重置IOS模拟器,能想到的都试过了!请帮忙!

最佳答案

当我的纹理图集中有太多大图像时,这个错误发生在我身上。将其拆分为两个独立的 map 集后,游戏构建良好。

关于ios - TextureAtlas 工具不读取纹理图集 - SpriteKit 纹理图集生成器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22213422/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com