Questions tagged [caemitterlayer]

The CAEmitterLayer class provides a particle emitter system for Core Animation. The particles are defined by instances of CAEmitterCell.

The CAEmitterLayer class provides a particle emitter system for Core Animation. The particles are defined by instances of CAEmitterCell. Inherits from CALayer : NSObject

CAEmitterLayer Class Reference: Official Apple Documentation

98 questions
38
votes
3 answers

CAEmitterLayer emits random unwanted particles on touch events

I'm trying to set up a CAEmitterLayer to make a confetti effect, and I've run into two issues: Whenever I set the birthRate on my cells to something non-zero to start the animation I get a flurry of cells placed randomly on screen, which animate…
Sam V.
  • 411
  • 4
  • 8
21
votes
2 answers

iOS 7 CAEmitterLayer spawning particles inappropriately

Strange issue I can't seem to resolve where on iOS 7 only, CAEmitterLayer will spawn particles on the screen incorrectly when birth rate is initially set to a nonzero value. It's as if it calculates the state the layer would be in the future. //…
Ryan F
  • 367
  • 3
  • 14
15
votes
1 answer

Initial particles from CAEmitterLayer don't start at emitterPosition

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…
WaltersGE1
  • 813
  • 7
  • 26
15
votes
2 answers

UIView self.layer.shouldRasterize = YES and performance issues

I would like to share my experience from using self.layer.shouldRasterize = YES; flag on UIViews. I have a UIView class hierarchy that has self.layer.shouldRasterize turned ON in order to improve scrolling performance (all of them have STATIC…
Summon
  • 968
  • 1
  • 8
  • 19
14
votes
1 answer

Is there any kind of particle emitter on Android like iOS CAEmitterLayer for circle emitter?

My issue is difficult to resolve as of now. I am supposed to develop an Android application alongside my colleage that does the same thing but on iOS. At the end of the development, we are supposed to deliver two applications that do the same thing…
Mackovich
  • 3,319
  • 6
  • 35
  • 73
14
votes
1 answer

How can I animate in the entrance of a CAEmitterCell?

Currently my particles appear on screen abruptly in their full shape and form. What I want is for the cells to either start at 0.0 opacity and animate up to full opacity, or start at 0.0 scale and animate up to 1.0 scale. I can't find anything…
Snowman
  • 31,411
  • 46
  • 180
  • 303
12
votes
6 answers

CAEmitterLayer how to emit for a short time repeatedly

I'm playing around with CAEmitterLayer and I face some problems now :( I need a short particle effect - like a hit or explosion - at one place for example (so I have small UIView at this place). How should I do that? 1, I had an idea - create the…
D33
  • 239
  • 1
  • 3
  • 14
10
votes
1 answer

Fading out emitter cells with Core Animation

I am creating a particle animation with CAEmitterLayer and CAEmitterCell instances. There is no problem with the animation but I want them to fade out slowly. I am using the code below but the particles disappear suddenly, no fade out animation…
Élodie Petit
  • 5,774
  • 6
  • 50
  • 88
9
votes
2 answers

CAEmitterCell does not respect birthRate change

I would like to create a particle effect which is only emitting while the user touches the screen, but I cannot change the CAEmitterCell birthRate property once is set to a non zero value. I have a subclass of UIView, which sets up my CAEmitterLayer…
nekiTamoTip
  • 173
  • 8
7
votes
1 answer

CAEmitterLayer negative beginTime possible?

I'm trying to get CAEmitterLayers and CAEmitterCells to start their animation from somewhere in the middle of their parent's duration. Is this possible at all? I tried playing with the beginTime and timeOffset properties but I can't seem to get this…
John Estropia
  • 17,460
  • 4
  • 46
  • 50
6
votes
1 answer

How can I make animation with CAEmitterLayer on SwiftUI?

How can I convert this code to SwiftUI. It's a snow effect. I used CAEmitterLayer but I don't know how to use it in SwfitUI. There is no addSublayer in SwiftUI. Is it possible to run this code without using UIHostingController ? let size =…
Ufuk Köşker
  • 1,288
  • 8
  • 29
6
votes
4 answers

What is the proper way to end a CAEmitterLayer in Swift?

I've mostly seen examples of continuous emitters in Swift, and I've found one example in Obj-C by setting the birthRates of the emitter cells to 0.0, but it doesn't seem to work, so I must be doing something wrong. In my example, I can see the…
Chewie The Chorkie
  • 4,896
  • 9
  • 46
  • 90
6
votes
2 answers

CAEmitterCell color property not working

I have some strange behaviour of CAEmitterCell color property or I don't understand it right. I have a cell let cell = CAEmitterCell() With content of simple .png file which is drawn black cell.contents = UIImage(named: "particle")?.cgImage And I…
pulp
  • 1,768
  • 2
  • 16
  • 24
6
votes
2 answers

Changing CAEmitterCell properties of CAEmitterLayer after emission starts

When I first set up the emitter I can do this: self.cell = [CAEmitterCell emitterCell]; self.cell.yAcceleration = 20; ... self.emitter.emitterCells = [NSArray arrayWithObjects:self.cell,nil]; But say I create a timer that fires 5 seconds later, and…
soleil
  • 12,133
  • 33
  • 112
  • 183
6
votes
3 answers

animating the CAEmitterCell Color property

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…
Alan Taylor
  • 493
  • 4
  • 16
1
2 3 4 5 6 7