能産生粒子效果的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設定才有效......