How to export an image drawn in SpriteKit

So I have an SKScene in SpriteKit, and I am trying to export the scene as an image, but have no idea how.

Answered by Graphics and Games Engineer in 793904022

You can use SKRenderer to render the scene to a texture using Metal. You can then use ImageIO to export the texture’s data to an image file.

Accepted Answer

You can use SKRenderer to render the scene to a texture using Metal. You can then use ImageIO to export the texture’s data to an image file.

How to export an image drawn in SpriteKit
 
 
Q