iOS fireworks fire rain Snowflakes and other special effects properties

Source: Internet
Author: User

Caemitterlayer *snowemitter = [Caemitterlayer layer];  Example launch positionSnowemitter.emitterposition = Cgpointmake (120,20); Size of emission sourceSnowemitter.emittersize = Cgsizemake (Self.view.bounds.size.width *20,20); Launch modeSnowemitter.emittermode = Kcaemitterlayersurface; The shape of the emitter sourceSnowemitter.emittershape = Kcaemitterlayerline;  Create a snowflake-type particleCaemittercell *snowflake = [Caemittercell Emittercell]; The name of the particleSnowflake.name =@ "Snow"; Velocity multiplier factor for particle parametersSnowflake.birthrate =1.0;Snowflake.lifetime =120.0; Particle velocitySnowflake.velocity =10.0; Velocity range of particlesSnowflake.velocityrange =10; Acceleration components in the Y-direction of particlesSnowflake.yacceleration =2; Surrounding emission angleSnowflake.emissionrange =0.5 * M_PI; Sub-rotation angle rangeSnowflake.spinrange =0.25 * M_PI;Snowflake.contents = (ID) [[UIImage imagenamed:@ "Dazflake"] cgimage]; Set the color of a snowflake-shaped particleSnowflake.color = [[Uicolor colorwithred:0.200 Green:0.258 Blue:0.543 Alpha:1.000] cgcolor];  Create a star-shaped particleCaemittercell *snowflake1 = [Caemittercell Emittercell]; The name of the particleSnowflake1.name =@ "Snow"; Velocity multiplier factor for particle parametersSnowflake1.birthrate =1.0;Snowflake1.lifetime =120.0; Particle velocitySnowflake1.velocity =10.0; Velocity range of particlesSnowflake1.velocityrange =10; Acceleration components in the Y-direction of particlesSnowflake1.yacceleration =2; Surrounding emission angleSnowflake1.emissionrange =0.5 * M_PI; Sub-rotation angle rangeSnowflake1.spinrange =0.25 * M_PI; The color of the particle's content and contentSnowflake1.contents = (ID) [[UIImage imagenamed:@ "Dazstaroutline"] cgimage];Snowflake1.color = [[Uicolor colorwithred:0.600 Green:0.658 Blue:0.743 Alpha:1.000] cgcolor];  snowemitter.shadowopacity = 1.0; Snowemitter.shadowradius = 0.0; Snowemitter.shadowoffset = Cgsizemake (0.0, 1.0);  //particle edge color snowemitter.shadowcolor = [[Uicolor redcolor] cgcolor];  snowemitter.emittercells = [Nsarray arraywithobjects:snowflake,snowflake1,nil]; [Self.view.layer insertsublayer:snowemitter Atindex:0];  additional setup after loading the view           

iOS fireworks fire rain Snowflakes and other special effects properties

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.