caemitterlayer

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

how to get the emitter position of an animated CAEmitterLayer/Cell?

我只是一个虾纸丫 提交于 2020-01-03 03:41:07
问题 I have a animated CAEmitterLayer with CAEmitterCell and the animation runs well with fireEmitter = (CAEmitterLayer*)self.layer; fireEmitter.emitterPosition = CGPointMake(50, 50); fireEmitter.emitterSize = CGSizeMake(10, 10); CAEmitterCell* fire = [CAEmitterCell emitterCell]; ... [fire setName:@"fire"]; CAKeyframeAnimation *anim = [CAKeyframeAnimation animationWithKeyPath:@"emitterPosition"]; anim.path = theBezierPath.CGPath; anim.calculationMode = kCAAnimationCubicPaced; anim.repeatCount =

Touches Moved CAEmitterLayer delayed in dinstance after touch point…

谁都会走 提交于 2019-12-25 00:19:16
问题 I stumbled from one problem to another one: Solving the first problem, now my particle trail is delayed way behind the touch position when a finger moves over the screen. it worked great when I was initialising the CAEmitterLayer by overwriting + (Class) layerClass { //configure the UIView to have emitter layer return [CAEmitterLayer class]; } and the initializing with fireEmitter = (CAEmitterLayer*)self.layer; I changed that to fireEmitter = [CAEmitterLayer layer]; fireEmitter.frame = self

Particle system looks different on iOS 6 and ios7

放肆的年华 提交于 2019-12-12 02:27:13
问题 I have a couple of particle systems on my app that I checked originally on an iPad 3 with ios7. The particles looked and behaved like I expected them, but when I test on an iPad2 with ios6. The particles are displaced up and are smaller. I have a subclass for the particles. Here's the code for one of my particle systems. I was wandering if the CGREctMake is positioning the particle in a different area on a non retina display, but that doesn't happen when I position other things on the display

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

Create a circle of particles using CAEmitterLayer

泄露秘密 提交于 2019-12-08 11:17:18
问题 I'm trying to use the UIKit CAEmitterLayer to give feedback to the user when he touches the screen. What I'd like to do is a circle of particles, that grows overtime. I was thinking that if I setup the particles with the same speed (no velocity range), the particles would all move from the center point at the same speed, and therefore, draw a circle. However, it looks like the speed is still random, in a range between 0 and the speed I've chosen as velocity. Is there a way to force the speed

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