5

iOS 5 のパーティクル システム (CAEmitterLayer および CAEmitterCell) を使用して、円 (CGPath) の周りにパーティクルを描画しようとしていますが、その方法がわかりません。私ができる最善の方法は (CAEmitterCell の yAcceleration プロパティを変更して) 円弧を作成することですが、完全な円を作成することはできません。もちろん、円をシミュレートするために複数の円弧を作成することもできますが、「結び目」が非常に目立ちます。また、エッジのパーティクルがトリミングされているように見えるため、マスクを使用したくありません。それを行う方法はありますか?

4

3 に答える 3

3

CAKeyframeAnimation を使用して、emitterPosition をアニメーション化できます。

CAKeyframeAnimation *particleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"emitterPosition"];
[particleAnimation setPath:yourPath];
[particleAnimation setDuration:1.0];
[particleAnimation setCalculationMode:kCAAnimationPaced];
[yourEmitterLayer addAnimation:particleAnimation forKey:@"yourAnimation"]; 
于 2012-03-04T15:16:16.087 に答える
0

使いたいparticleEmitter.emitterShape = kCAEmitterLayerCircle

http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CAEmitterLayer_class/Reference/Reference.html

于 2012-03-22T14:03:28.457 に答える
0
yourEmitter.emitterShape = kCAEmitterLayerCircle;
yourEmitter.emitterMode = kCAEmitterLayerOutline;
于 2013-08-28T17:01:20.340 に答える