How do you maintain low energy impact when adding many SKSpriteNodes in a SpriteKit game

41 Views Asked by At

I've currently been working on a battle scene for my app similar to what you would see in pokemon, with HUD for each character (3 characters per side). For each label and image I have been using

addChild(SKSpriteNode)

adding each label and character to the screen individually. At its current state my screen has 70 nodes on it and my draw count is over 100 making things very laggy. What is a more efficient way to do this?

1

There are 1 best solutions below

2
bg2b On

Make sure ignoresSiblingOrder is true (use zPosition to control the layering and try to keep the number of distinct positions small). If your sprite nodes have different textures, be sure they're in an atlas. And avoid shape and label nodes.