Questions tagged [caemittercell]

The CAEmitterCell class is available in OS X v10.6 and later, and represents one source of particles being emitted by a CAEmitterLayer object.

The CAEmitterCell class represents one source of particles being emitted by a CAEmitterLayer object. An emitter cell defines the direction and properties of the emitted particles. Emitter cells can have an array of sub-cells, which lets the particles themselves emit particles.

51 questions
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
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
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
6
votes
1 answer

CAEmitterLayer: Using an @2x (retina) png image with CAEmitterCell

Using CAEmitterLayer, @2x (retina) images aren't being scaled property like they do elsewhere in iOS. The result I'm getting is the @2x version is being displayed 4x the size of the non-retina image instead of being scaled down. Any idea of how to…
W Dyson
  • 4,604
  • 4
  • 40
  • 68
5
votes
1 answer

CAEmitterCell - slow stars or light effect

I'm playing around with CAEmitterCell, but most effects are very fast effects like the firework. But I want to have a slow "stars" effect like you see here on www.findyourwaytooz.com How can I do that with CAEmitterCell? Thank you :)
cuSoon2013
  • 255
  • 6
  • 12
4
votes
1 answer

CAEmitterLayer not timing correctly with CACurrentMediaTime() and sometimes not showing at all

I am currently making a particle emitter using CAEmitterLayer and ran into the issue of the layer preloading the animation when I start it and hence the particles all over the place when I show it. Many answers have said the culprit is…
Roodey
  • 55
  • 8
4
votes
0 answers

Animating already emitted CAEmitterCell objects

I have a CAEmitterCell that I am using to emit a continuous background for my game. When the player "dies", I want the background to slow to a stop, so I did this: - (void)stopAllEmitters:(NSTimeInterval)duration { for(CAEmitterLayer* layer in…
Liftoff
  • 24,717
  • 13
  • 66
  • 119
3
votes
1 answer

How to use CAEmitterLayer on macOS in a SwiftUI app using NSViewRepresentable

I want to use a CAEmitterLayer within a macOS app that is based on SwiftUI. Problem: The layer itself is perfectly visible, but it doesn’t emit any particles. → Here’s my demo project on GitHub I basically built a NSViewRepresentable for a custom…
ixany
  • 5,433
  • 9
  • 41
  • 65
3
votes
1 answer

iOS (Swift) Changing a property of a CAEmitterCell after it's been initialised

My aim is to create a fire effect using a CAEmitterLayer, whose strength can be altered via changing the value of the alphaSpeed property of its given CAEmitterCells. A smaller value of the alphaSpeed would result in a "roaring" fire, whilst a…
ajrlewis
  • 2,968
  • 3
  • 33
  • 67
3
votes
0 answers

CAEmitterCell automatically stop to emitting after sometime

CAEmitterCell emitting for 2 to 3 minutes but after it stops to emitting automatically. So my question is how can I set CAEmitterCell so that it will emitting infinite. Is there is a way to continuously emitting the CAEmitterCell or Is there any…
Jagat Dave
  • 1,643
  • 3
  • 23
  • 30
3
votes
1 answer

CAEmitterCell without using an image?

I'm having trouble finding enough documentation on CAEmitterCell. It's contents seem to be able to set to any object, but as far as I can tell from examples online it's always been set to an UIImage. Is there any way to set anything else to the…
Vadoff
  • 9,219
  • 6
  • 43
  • 39
1
2 3 4