天天看点

能产生粒子效果的CAEmitterLayer

能产生粒子效果的caemitterlayer

能产生粒子效果的CAEmitterLayer
能产生粒子效果的CAEmitterLayer
能产生粒子效果的CAEmitterLayer

下雪效果:

烟花效果:

/* the birth rate of each cell is multiplied by this number to give the

 * actual number of particles created every second. default value is one.

 * animatable. */

@property float birthrate;

/* the cell lifetime range is multiplied by this value when particles are

 * created. defaults to one. animatable. */

@property float lifetime;

/* the center of the emission shape. defaults to (0, 0, 0). animatable. */

@property cgpoint emitterposition;

@property cgfloat emitterzposition;

/* the size of the emission shape. defaults to (0, 0, 0). animatable.

 * depending on the `emittershape' property some of the values may be

 * ignored. */

@property cgsize emittersize;

@property cgfloat emitterdepth;

/* multiplies the cell-defined particle velocity. defaults to one.

@property float velocity;

/* multiplies the cell-defined particle scale. defaults to one. animatable. */

@property float scale;

/* multiplies the cell-defined particle spin. defaults to one. animatable. */

@property float spin;

你需要知道的非常重要的细节:

caemittercell的动画属性挺多的,但有点奇葩的是,必须是通过kvc设置值才行的通,而且,动画结束时的值也必须通过kvc设置才有效......

能产生粒子效果的CAEmitterLayer

继续阅读