caemittercell

CAEmitterCell with 3D rotation

拟墨画扇 提交于 2020-01-30 08:11:49
问题 I'm trying to reproduce pieces of small paper falling from top effect, using CAEmitterLayer & CAEmitterCell. So far, I got the 2D animation of it, But I'm having difficulty to make each cell to rotate when falling. How to I apply random rotation on each particle? I tried with 3D Transform with no success so far. This is what I got: -(void) configureEmitterLayer { self.emitterLayer = [CAEmitterLayer layer]; self.emitterLayer.emitterPosition = CGPointMake(self.backgroundContainer.bounds.size

CAEmitterCell with 3D rotation

徘徊边缘 提交于 2020-01-30 08:11:26
问题 I'm trying to reproduce pieces of small paper falling from top effect, using CAEmitterLayer & CAEmitterCell. So far, I got the 2D animation of it, But I'm having difficulty to make each cell to rotate when falling. How to I apply random rotation on each particle? I tried with 3D Transform with no success so far. This is what I got: -(void) configureEmitterLayer { self.emitterLayer = [CAEmitterLayer layer]; self.emitterLayer.emitterPosition = CGPointMake(self.backgroundContainer.bounds.size

animating the CAEmitterCell Color property

纵然是瞬间 提交于 2019-12-10 14:57:31
问题 I have a CAEmitterCell and I have set it up with a specific colour. The documentation says that this property is animatable, and I would like to animate this between a number of different colours for the different players in my game (all of whom choose their color at the start). Here is my EmitterCell when I set it up: // // Emitter Cells // // 'New Emitter' cell configuration newEmitter = [CAEmitterCell emitterCell]; newEmitter.scaleSpeed = 10; newEmitter.lifetime = 2.481715; newEmitter

CAEmitterCell does not respect the duration value

﹥>﹥吖頭↗ 提交于 2019-12-09 23:43:33
问题 I have an emitter that I want to end after 2 seconds, but I can't get it to stop running! my code is as follows: // Emitter Layer // emitter = [CAEmitterLayer layer]; emitter.emitterSize = CGSizeMake(20, 20); emitter.renderMode = @"additive"; emitter.emitterMode = @"points"; emitter.emitterShape = @"rectangle"; emitter.emitterPosition = CGPointMake(310, 230); //emitter.duration = 2; // setting duration on the emitterLayer prevents anything from firing it seems // Emitter Cells // // 'New

CAEmitterCell does not respect the duration value

我是研究僧i 提交于 2019-12-04 19:54:17
I have an emitter that I want to end after 2 seconds, but I can't get it to stop running! my code is as follows: // Emitter Layer // emitter = [CAEmitterLayer layer]; emitter.emitterSize = CGSizeMake(20, 20); emitter.renderMode = @"additive"; emitter.emitterMode = @"points"; emitter.emitterShape = @"rectangle"; emitter.emitterPosition = CGPointMake(310, 230); //emitter.duration = 2; // setting duration on the emitterLayer prevents anything from firing it seems // Emitter Cells // // 'New Emitter' cell configuration newEmitter = [CAEmitterCell emitterCell]; newEmitter.scaleSpeed = 7; newEmitter

Initial particles from CAEmitterLayer don't start at emitterPosition

拜拜、爱过 提交于 2019-12-04 00:10:59
问题 My goal is to make an explosion-like animation where many particles are emitted in a short duration. My problem is that CAEmitterLayer, when it begins emitting, adds "future" particles to make it looks like the animation has been running for a while. How can I disable or workaround this? When I increase the birthRate, I only want particles to start appearing from the emitterPosition, and not at all points along the CAEmitterCell's projected lifetime. Any help is appreciated. #import

Initial particles from CAEmitterLayer don't start at emitterPosition

穿精又带淫゛_ 提交于 2019-12-01 03:18:42
My goal is to make an explosion-like animation where many particles are emitted in a short duration. My problem is that CAEmitterLayer, when it begins emitting, adds "future" particles to make it looks like the animation has been running for a while. How can I disable or workaround this? When I increase the birthRate, I only want particles to start appearing from the emitterPosition, and not at all points along the CAEmitterCell's projected lifetime. Any help is appreciated. #import "EmitterView.h" @interface EmitterView () @property CAEmitterLayer* emitter; @end @implementation EmitterView -