sprite kit - SKShapeNode consuming too much memory and slowing down animation -Spritekit iOS -


I'm using SKShapeNode to create mountains like objects. I use CGMutablePathRef to give marks to my path

  SKShapeNode * shapenode = [[SKShapeNode alloc] init]; CGMutablePathRef Path = CGPathCreateMutable (); CGPathMoveToPoint (path, zero, 0, 0); For ...... (int i = 0; i & lt; [refData count]; i ++) {CGPathAddLineToPoint (path, zero, ((boat) I / [refData count]) * screenWidthBoundry, [[ RefData objectAtIndex: i] double value]); } CGPathAddLineToPoint (path, tap, screenwidth boundary, 0); CGPathAddLineToPoint (path, zero, 0, 0); Shapenode.path = Path; Size.NOTE test = yes; SizeNode.philoclor = [SKColor colorWithRed: 17.0 / 255.0 Green: 108.0 / 255.0 Blue: 125.0 / 255.0 Alpha: 1.0]; //shapenode.strokecolor = [UIColor clear collar]; Order node.linewidth = 1.0f; Shapenode.physicsBody = [EdgeChainFromPath: Path] with SKPhysicsBody body; SizeNode.FixixBody.PoweredBegravity = No. Akarnonode.FizixBody Carbot Mask = Confrontation Field; Affected graphicsBody cullingbitmask = 0; SizeNode.FixixBody Contacttestbitmask = collision typebird; CGPathRelease (path); Shape change;  

My problem is that SkShapeNode is slowing down the animation on the iPhone 4 (it runs smoothly on the iPad and iPhone 5 but still does not have 60 fps) am I easily animated Can I cache the squandonode object to run? Any help is appreciated !!

I consume very many CPU resources with SKShapeNodes and in the same problem with the killing of framerate was going on. Use your SKView's textureFromNode: to create a SKTTxture. Now create a SKSpriteNode with SKTtexture generating your footage. This will fix your performance problems.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -