close
Lets say that you have a particle already created called MyParticle.sks.
First, you have to create a SKEmitterNode with your particle:
NSString *myParticlePath = [[NSBundle mainBundle] pathForResource:@"MyParticle" ofType:@"sks"];
SKEmitterNode *myParticle = [NSKeyedUnarchiver unarchiveObjectWithFile:myParticlePath];
Now that the node is created, you can edit some parameters if you want:
myParticle.particlePosition = CGPointMake(100, 100);
myParticle.particleBirthRate = 5;
And the add it to your scene:
[self addChild:myParticle];
This has to be added to your SKScene
http://stackoverflow.com/questions/18891503/how-to-add-particles-using-spritekit-in-ios7
全站熱搜
留言列表