ios - Suspend Particles in CAEmitterLayer -


i have following code adds particles uiview named parentview @ center of other uiview:

caemitterlayer *emitterlayer = [caemitterlayer layer]; emitterlayer.emitterposition = cgpointmake(view.center.x, view.center.y - view.frame.size.height / 3); emitterlayer.emitterzposition = 10; emitterlayer.emittersize = cgsizemake(view.bounds.size.width, 0); emitterlayer.emittershape = kcaemitterlayersphere;  caemittercell *emittercell = [caemittercell emittercell]; emittercell.scale = 0.1; emittercell.scalerange = 0.2; emittercell.emissionrange = 45; emittercell.lifetime = 0.75; emittercell.birthrate = 60; emittercell.velocity = 200; emittercell.velocityrange = 50; emittercell.yacceleration = 250; emittercell.contents = (id)[[uiimage imagenamed:@"particle.png"] cgimage];  emitterlayer.emittercells = [nsarray arraywithobject:emittercell]; [parentview.layer addsublayer:emitterlayer]; 

everything works want pause or suspend animation, particles "freeze". can done?

i think pause layer work,

-(void)pauselayer:(calayer*)layer {     cftimeinterval pausedtime = [layer converttime:cacurrentmediatime() fromlayer:nil];     layer.speed = 0.0;     layer.timeoffset = pausedtime; } 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -