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
1
vote
1 answer

Add CAEmitterCell to another CAEmitterCell

I'm trying to do a particle effect where I have a cell nested onto another cell. Think of the basic firework example they have here in the Apple Docs. They've nested Cells into other Cells and they've timed them using the BeginTime parameter. I,…
LampShade
  • 2,675
  • 5
  • 30
  • 60
1
vote
1 answer

CAEmitterCell access to all particles

I have a CAEmitterCell working but I want the particles to slow down and stop. It seems if I had access to all the particles then I could just reduce their velocity and/or acceleration to 0 and they would stop moving. I tried something like…
Paul Cezanne
  • 8,629
  • 7
  • 59
  • 90
1
vote
1 answer

CAEmitterCell does not respect the duration value

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 =…
Alan Taylor
  • 493
  • 4
  • 16
1
vote
1 answer

Sparkling effect on UIView random position and start time

How to create a magic like sparkling effect on app?
Prince Kumar Sharma
  • 12,591
  • 4
  • 59
  • 90
1
vote
1 answer

Issues with code that works with CAEmitterLayer

I want to make Confetti effect after user guess correctly, I searched the web and found something that looks really good, but it only have the .m file, I don't have any idea what to do with the header file. This is the link to the page with the…
ytpm
  • 4,962
  • 6
  • 56
  • 113
1
vote
1 answer

Create a circle of particles using CAEmitterLayer

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…
Antoine Pastor
  • 207
  • 3
  • 11
1
vote
1 answer

How to get a smaller tail with a bunch of CAEmitterCells (fade out and/or scale down)

I have a CAEmitterLayer animated along a bezierPath and my CEEMitterCell particles are made with an partly transparent gaussed-circle.png. these particles have a lifetime of 0.3 which leads to a small tail of my animated CAEmitterLayer-Particles. I…
headkit
  • 3,307
  • 4
  • 53
  • 99
1
vote
1 answer

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

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); …
headkit
  • 3,307
  • 4
  • 53
  • 99
0
votes
0 answers

CAEmitterLayer works for a while, then stops diplaying. Objective C

I have added some fireworks to an app. The emitters work a few times, then stops displaying. Here is the Objective C code in the .m - (void) viewDidLoad { [super viewDidLoad]; [self setupEmitter]; [self setupFireWorkEmitterCells]; …
jsdigital
  • 21
  • 2
0
votes
1 answer

How can I emit particles with a circular trajectory on iOS?

I would like to emit a sequence of particles using iOS that move in a circle. All the particles can start near the same location, and should have some variance in their angle/size/etc like with most particle emitters. But I cannot figure out way to…
Benr783
  • 2,860
  • 4
  • 20
  • 28
0
votes
0 answers

CAEmitterCell does not show colour at all

I have looked for this problem over the internet but unable to find any solution related to my problem. Here is the code that I wrote so far. Creating CAEmitterLayer as follows: func createParticles() { let particleEmitter =…
0
votes
0 answers

How to make CAEmitterCell fade-in and then fade-out?

I am using CAEmitterLayer to emit some star images. Our clients want to change the alpha of the star from 0 to 1 , and then to 0. I know we can use alphaSpeed property of CAEmitterCell to increase or decrease the alpha, but how to change the alpha…
Rufus
  • 640
  • 1
  • 7
  • 14
0
votes
1 answer

CAEmitterLayer Stops Displaying

I adapted this code for SwiftUI to display confetti particles, but sometimes the particle emitter does not work. I've noticed that this often happens after sending to background (not killing the app entirely) and reopening it, or simply letting the…
bze12
  • 727
  • 8
  • 20
0
votes
1 answer

I can't add UIBezierPath to CAEmitterCell's contents variable

I could not add an icon I drew with UIBezierPath to CAEmitterCell. I wonder if the icon is not drawn? ShapeView does not work when I run the application. However, you may find that the ShapeView works when you use it normally. So do I have a chance…
Ufuk Köşker
  • 1,288
  • 8
  • 29
0
votes
1 answer

Adding different objects to CAEmitterLayer with forEach with SwiftUI

When I add more than one object, I have to write one by one as below. When I want to add 2 or more objects, I always have to copy and paste. I don't want that and I tried doing it with forLoop, but I only see whatever object was added…
Ufuk Köşker
  • 1,288
  • 8
  • 29