如何为SpriteKit制作地图集?我试着把我所有的图像传送到某个文件夹并给它分机。在结果文件夹将调用"somefolder.atlas“。用它的方法对吗?
发布于 2014-02-23 16:26:44
听起来没错。确保您还在Xcode设置中启用了地图集生成(请查看有关此的official documentation,并提供一步一步的图片)。
然后,假设您的地图集文件夹名为"somefolder.atlas“,并且包含一个文件"1.png",您可以这样做:
SKTextureAtlas *atlas = [SKTextureAtlas atlasNamed:@"somefolder"];
SKTexture *texture = [atlas textureNamed:@"1"];
SKSpriteNode *sprite = [SKSpriteNode spriteWithTexture:texture];https://stackoverflow.com/questions/21970781
复制相似问题