Reputation: 30461
I am making a game in SpriteKit. I am creating a SKShapeNode
and adding it to a SKSpriteNode
(stone) already in the scene.
shapeNode = SKShapeNode(path: self.oldPath)
shapeNode.fillColor = wave.color
shapeNode.strokeColor = .clear
shapeNode.position = CGPoint(x: 0, y: -5) // Offset for wave paths
stone.addChild(shapeNode)
Here is what is strange, the total scene's draws:
When I say "not set", I mean that I commented out that line.
It appears that setting fillColor
increases the draws by 3
, and setting strokeColor
decreases the draws by 1
, although doing this does not produce the desired shape node.
What is causing the increase in draw calls, and how can I prevent/reduce this?
Edit 1:
The problem is that this is an animating wave around a stone (as if there is a stone in water, see image above). It would not increase performance by rasterising it and make it as a sprite texture, as the wave is constantly animating. This would most likely decrease performance.
I also don't want to use an Atlas to quickly change a texture, as I want this wave to look random, smooth, and natural.
Upvotes: 0
Views: 130