Atlas texture cannot be found.

I have a texture atlas called plane1.atlas that contains a lot of images. When I start the Atlas and try to use one of the textures, I get the error "The texture atlas could not be found." As you can see in the next photo, I have a code to initialize the texture, I have a texture atlas in the kit, and an error is displayed in the error log.

atlas problems

I have the correct settings in the target settings, I tried to rename the texture atlas and use file name extensions when initializing / using any of the textures (I added that .atlas and .png do not work). I tried other images, but to no avail. It doesn’t work both on devices and on simulators, although I reset the contents / settings several times.

Here is the code if it is too small in the image:

SKSpriteNode *planeCore; SKSpriteNode *planeOutline; SKSpriteNode *planeEngine1; SKSpriteNode *planeEngine2; SKSpriteNode *planeWheels; SKSpriteNode *planeWindows; SKTextureAtlas *plane1Atlas = [SKTextureAtlas atlasNamed:@"planeAtlas"]; planeCore = [SKSpriteNode spriteNodeWithTexture:[plane1Atlas textureNamed:@"plane1Core1"]]; planeCore.position = CGPointZero; planeCore.zPosition = 500; [self addChild:planeCore]; 
+5
source share
1 answer

Some instructions say you need to add a "New Folder" and then add images.

I had the same problem solved;

Delete a folder. Add a new Sprite attribute (Xcode, right-click in the outline view) Add images to the new atlas.

0
source

Source: https://habr.com/ru/post/1207271/


All Articles