1
使用CAEmitterLayer和Cell显示具有方向敏感内容图像的粒子(箭头)。根据动画方向旋转CAEmitterCell内容
想要内容(箭头图像)指向细胞移动的方向。
这里是让所有箭头从外边缘向中心移动的代码。如何在运动的方向旋转图像,图像点:
emitterLayer = [CAEmitterLayer layer];
emitterLayer.emitterPosition = self.view.center;
emitterLayer.emitterSize = self.view.bounds.size;
emitterLayer.emitterMode = kCAEmitterLayerOutline;
emitterLayer.emitterShape = kCAEmitterLayerRectangle;
CAEmitterCell* arrow = [CAEmitterCell emitterCell];
arrow.birthRate = 10;
arrow.velocity = 100;
arrow.emissionLatitude = M_PI;
arrow.scale = 0.5;
arrow.lifetime = 2;
arrow.contents = (id) [[UIImage imageNamed:@"arrowOutline.png"] CGImage];
emitterLayer.emitterCells = @[arrow];
[self.view.layer addSublayer:emitterLayer];
如何获得内容画面调整为基础,以对细胞运动的方向是什么?