Type Method

preloadTextureAtlasesNamed(_:withCompletionHandler:)

Loads the textures of multiple atlases into memory, calling a completion handler after the task completes.

Declaration

class func preloadTextureAtlasesNamed(_ atlasNames: [String], withCompletionHandler completionHandler: @escaping (Error?, [SKTextureAtlas]) -> Void)

Parameters

atlasNames

An array containing the atlas names to preload.

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 atlases are loaded, your completion handler is called.

See Also

Preloading Textures

func preload(completionHandler: () -> Void)

Loads an atlas object’s textures into memory, calling a completion handler after the task completes.

class func preloadTextureAtlases([SKTextureAtlas], withCompletionHandler: () -> Void)

Loads the textures of multiple atlas objects into memory, calling a completion handler after the task completes.