2

I want to blur the movement of fast moving nodes. I should look like it fades away behind the movement. Is there some easy solution to archive this?

It should somehow look like this movement:

enter image description here

Thanks in advance!

Update

I tried to call this every 0.0X seconds:

 for child in self.allNodes{          
            let node = SKSpriteNode(color: child.color, size: CGSizeMake(size, size))
            node.position = child.position
            self.addChild(node)
            node.runAction(SKAction.fadeOutWithDuration(0.2))
}

The problem is, that this solution is to expensive. It should be way easier. :/

Jonas
  • 2,139
  • 17
  • 38
  • Take a look at this if you are interested in a blur effect : http://stackoverflow.com/a/19734016/3402095 Also, I see you say that particle emitter is expensive for you and not what you are looking for. You say you just need a node to fade away, right ? Then why not just use fadeOut SKAction ? – Whirlwind Nov 13 '15 at 12:27
  • I dont need the node to fade away. I need the trail of the node to fade away. (Like a shooting star) – Jonas Nov 13 '15 at 12:33
  • Ah okay...Well in that case, the easiest and probably most performant solution would be SKEmitterNode (SpriteKit is pretty much optimized for this). But that's just me :) Also maybe you can try with predefined animation (animateWithTextures). – Whirlwind Nov 13 '15 at 12:44

1 Answers1

3

Yo can create custom SpriteKit Particle File with fire effect. Then change it SpriteKit Particle Emmitter like you want to create effect you need. And create SKEmitterNode with with this particle effect like this:

// Create path name to file with particle effect
let sparkEmitterPath = NSBundle.mainBundle().pathForResource("Spark", ofType: "sks")!

// Create SKEmitterNode from this file
let sparkEmiter = NSKeyedUnarchiver.unarchiveObjectWithFile(sparkEmitterPath) as SKEmitterNode

// Configure it 
sparkEmiter.position = point
sparkEmiter.name = "sparkEmitter"
sparkEmiter.zPosition = 0
sparkEmiter.targetNode = self

// Add to Scene
self.addChild(sparkEmiter) 

In example file name is Spark.sks

Alexey Pichukov
  • 3,377
  • 2
  • 19
  • 22
  • 1
    thanks for your answer but this is a little to expensive for my project. The effect doesn't need to sparkle. The node just needs to slowly fade away – Jonas Nov 13 '15 at 11:48