preloadTextureAtlases(_:withCompletionHandler:)
Loads the textures of multiple atlas objects into memory, calling a completion handler after the task completes.
Declaration
class func preloadTextureAtlases(_ textureAtlases: [SKTextureAtlas], withCompletionHandler completionHandler: @escaping @Sendable () -> Void)class func preloadTextureAtlases(_ textureAtlases: [SKTextureAtlas]) asyncParameters
- textureAtlases:
An array of Sktextureatlas objects.
- completionHandler:
A block called after all of the texture atlases are loaded.
Discussion
SpriteKit creates a background task that loads the texture data from all of the specified atlas objects. Then, SpriteKit returns control to your game. After the atlas objects are loaded, your completion handler is called.