CAEmitterLayer属性
- NSArray<CAEmitterCell *> *emitterCells; // CAEmitterCell对象的数组,用于把粒子投放到layer上。
- @property float birthRate; //粒子产生速度系数,默认1.0
- @property float lifetime; // 粒子生命周期,存在时间
- @property CGPoint emitterPosition;//发射器在xy平面的中心位置
- @property CGFloat emitterZPosition;//发射器在z平面的位置
- @property CGSize emitterSize;//发射器的尺寸
- @property CGFloat emitterDepth;// 决定粒子形状的深度
- @property(copy) NSString *emitterShape;//发射器的形状
1.NSString * const kCAEmitterLayerPoint;//点的形状,粒子从一个点发出
2.NSString * const kCAEmitterLayerLine;//线的形状,粒子 从一条线发出
3.NSString * const kCAEmitterLayerRectangle;//矩形形状,粒子从一个矩形中发出
4.NSString * const kCAEmitterLayerCuboid;//立方体形状,会影响Z平面的效果
5.NSString * const kCAEmitterLayerCircle;//圆形,粒子会在圆形范围发射
6.NSString * const kCAEmitterLayerSphere;//球型
- @property(copy) NSString *emitterMode;// 发射模式
1.NSString * const kCAEmitterLayerPoints;//从发射器中发出
2.NSString * const kCAEmitterLayerOutline;//从发射器边缘发出
3.NSString * const kCAEmitterLayerSurface;//从发射器表面发出
4.NSString * const kCAEmitterLayerVolume;//从发射器中点发出```
`- @property(copy) NSString *renderMode;//发射器渲染模式`
1.NSString * const kCAEmitterLayerUnordered;//粒子无序出现
2.NSString * const kCAEmitterLayerOldestFirst;//声明久的粒子会被渲染在最上层
3.NSString * const kCAEmitterLayerOldestLast;//年轻的粒子会被渲染在最上层
4.NSString * const kCAEmitterLayerBackToFront;//粒子的渲染按照Z轴的前后顺序进行
5.NSString * const kCAEmitterLayerAdditive;//粒子混合
`- @property BOOL preservesDepth;//是否开启三维效果`
`- @property float velocity;//粒子速度`
`- @property float scale;//粒子的缩放比例`
`- @property float spin;//自旋转速度`
`- @property unsigned int seed;// 用于初始化随机数产生的种子`
###### emitterShape values// 发射源形状
CA_EXTERN NSString * const kCAEmitterLayerPoint
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);
CA_EXTERN NSString * const kCAEmitterLayerLine
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);
CA_EXTERN NSString * const kCAEmitterLayerRectangle
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);
CA_EXTERN NSString * const kCAEmitterLayerCuboid
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);
CA_EXTERN NSString * const kCAEmitterLayerCircle
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);
CA_EXTERN NSString * const kCAEmitterLayerSphere
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);
######emitterMode values 发射模式
CA_EXTERN NSString * const kCAEmitterLayerPoints
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);
CA_EXTERN NSString * const kCAEmitterLayerOutline
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);
CA_EXTERN NSString * const kCAEmitterLayerSurface
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);
CA_EXTERN NSString * const kCAEmitterLayerVolume
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);
######renderMode values 渲染模式
CA_EXTERN NSString * const kCAEmitterLayerUnordered
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);
CA_EXTERN NSString * const kCAEmitterLayerOldestFirst
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);
CA_EXTERN NSString * const kCAEmitterLayerOldestLast
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);
CA_EXTERN NSString * const kCAEmitterLayerBackToFront
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);
CA_EXTERN NSString * const kCAEmitterLayerAdditive
CA_AVAILABLE_STARTING (10.6, 5.0, 9.0, 2.0);