3
votes

What I have created in my SpriteKit project is a large two-dimensionally tiled background made up of about 160 sprite nodes. But to me, this seems extremely inefficient.

Would putting these nodes under a single parent make them more efficient? I would assume not and in that case is their a way to combine the textures themselves into a single node at run time?

I would simply use an image editor to tile these images but the size of said background will change between devices, and due to other factors within my project.

1
"I would simply use an image editor to tile these images but the size of said background will change between devices, and..." And what?0x416e746f6e
@AntonBronnikov Whoops didn't see it got cut off. Thanks!Daniel K.

1 Answers

2
votes

What you can do, in your loading phase, create the 160 sprite nodes needed to make your background under 1 parent node, then call let texture = scene.view.textureFromNode(parentNode), and use this texture for your BG sprite. When the loading phase ends, the 160 sprites should get destroyed