YY Live to praise the effect.
Fireworks Demo Effect
will continue to update the animation related small effects point I download the project-it feels good to point a star
Code Show
Self. View. BackgroundColor= [UicolorBlackcolor]; Self. Caelayer= [Caemitterlayer layer];//transmitter source Self. Caelayer. Emitterposition= Cgpointmake ( Self. View. Frame. Size. Width/2, Self. View. Frame. Size. Height- -);//emission source size Self. Caelayer. Emittersize= Cgsizemake ( -,0);//TX Source Mode Self. Caelayer. Emittermode= Kcaemitterlayeroutline;//The shape of the transmitting source Self. Caelayer. Emittershape= Kcaemitterlayerline;//Render mode Self. Caelayer. Rendermode= Kcaemitterlayeradditive;//Launch Direction Self. Caelayer. Velocity=1;//random particle generation Self. Caelayer. Seed= (Arc4random ()% -) +1;//CellCaemittercell *cell = [Caemittercell Emittercell];//RateCell. birthrate=1.0;//Angle of launchCell. Emissionrange=0.11* M_PI;//SpeedCell. Velocity= -;//RangeCell. Velocityrange= Max;//Y-axis acceleration componentsCell. Yacceleration= the;//Declaration periodCell. Lifetime=2.04;//is a Cgimageref object, both particles to show the pictureCell. Contents= (ID) [[UIImageimagenamed:@"Ffring"] Cgimage];//Zoom ratioCell. scale=0.2;//color of particlesCell. Color= [[UicolorColorwithred:0.6Green0.6Blue0.6Alpha1.0] Cgcolor];//A particle's color green can change the rangeCell. Greenrange=1.0;//A particle's color red can change the rangeCell. Redrange=1.0;//A particle's color blue can change the rangeCell. Bluerange=1.0;//Sub-rotation angle rangeCell. Spinrange= M_PI;//ExplosionCaemittercell *burst = [Caemittercell Emittercell];//particle generation factorBurst. birthrate=1.0;//SpeedBurst. Velocity=0;//Zoom ratioBurst. scale=2.5;//Shifting particle red change speed over the life cycleBurst. RedSpeed= -1.5;//Shifting particle blue changes speed over the life cycleBurst. Bluespeed= +1.5;//Shifting particle green change speed over the life cycleBurst. Greenspeed= +1.0;//life cycleBurst. Lifetime=0.35;//Spark and finally, the SparksCaemittercell *spark = [Caemittercell Emittercell];//particle generation factor, default = 1.0Spark. birthrate= -;//SpeedSpark. Velocity= the;//Ambient emission angleSpark. Emissionrange=2* M_PI;//gravity//y acceleration component in the direction of theSpark. Yacceleration= the;//Particle life cycleSpark. Lifetime=3;//is a Cgimageref object, both particles to show the pictureSpark. Contents= (ID) [[UIImageimagenamed:@"Fftspark"] Cgimage];//Zoom rateSpark. Scalespeed= -0.2;//Particle green change speed over the life cycleSpark. Greenspeed= -0.1;//particle red change speed over the life cycleSpark. RedSpeed=0.4;//particle blue changes speed over the life cycleSpark. Bluespeed= -0.1;//particle transparency change speed over the life cycleSpark. Alphaspeed= -0.25;//Sub-rotation angleSpark. Spin=2* M_PI;//Sub-rotation angle rangeSpark. Spinrange=2* M_PI; Self. Caelayer. Emittercells= [NsarrayArraywithobject:cell]; Cell. Emittercells= [NsarrayArraywithobjects:burst,Nil]; Burst. Emittercells= [NsarrayArraywithobject:spark]; [ Self. View. LayerAddsublayer: Self. Caelayer];
These two small effects are seen on a platform, and the finishing study is put on my github. For your own learning, and provide to interested small partners.
————————————— Weibo @ Summer is a grown-up qqq:498143780 —————————————
IOS Faux yy Live Heart Animation & Fireworks Animation