An image, decoded on the GPU, that can be used to render various SpriteKit objects.
- iOS 7.0+
- macOS 10.9+
- tvOS 9.0+
- watchOS 3.0+
SKTexture object is an image that can be applied to
SKShape objects, particles created by an
SKEmitter object, or tiles used in an
SKTile. A texture object manages the texture data and graphics resources that are needed to render the image. Most texture objects are created from source images stored in your app bundle—your game’s artwork. Once created, a texture object’s contents are immutable. Multiple sprites can share the same texture object, sharing a single resource.
Deallocating a Texture
After a texture is loaded into the graphics hardware memory, it stays in memory until the referencing
SKTexture object is deleted. This means that between levels (or in a dynamic game), you may need to make sure a texture object is deleted. Delete a
SKTexture object by removing any strong references to it, including: