0

First I added textures to the project before compilation and SKTextureAtlas created a set of textures with correct size based on .atlasc folder. But when the number of textures grows it becomes not rational to store them in project so I started to load them from net. SKTextureAtlas doesn't assemble them but asks to add them manually by picture. I use TexturePacker to store textures. How to work with textures loaded from net? Or how to cut out them from texturePacker correctly using JSON or .plist?

  • 1
    Possible duplicate of [How do I create SKTextureAtlas at run time from plist in SpriteKit?](https://stackoverflow.com/questions/52224177/how-do-i-create-sktextureatlas-at-run-time-from-plist-in-spritekit) – Knight0fDragon Sep 10 '18 at 11:48
  • Do not ask the same question twice, you could have reworded your other question to encompass this question. – Knight0fDragon Sep 10 '18 at 11:49
  • Also, if you plan on not hosting your own server, you can do asset on demand. So even though your project may be huge, Apple will not download files until they are needed, allowing to keep the initial package size small. – Knight0fDragon Sep 10 '18 at 11:51

1 Answers1

0

You can simply create SKTextureAtlas at runtime using class method: atlasWithDictionary:. Just feed it with images you downloaded from anywhere.

More details see in documentation: https://developer.apple.com/documentation/spritekit/sktextureatlas/1427383-atlaswithdictionary?language=objc

Max Gribov
  • 388
  • 2
  • 7