爆炸的效果(IOS)
发表时间:2020-10-19
发布人:葵宇科技
浏览次数:20
爆炸的效不雅(IOS)
by 伍雪颖
[img]http://img.blog.csdn.net/20150105145431593?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcmFpbmxlc3Zpbw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center
CAEmitterLayer *emitter = [CAEmitterLayer layer];
emitter.frame = self.view.bounds;
[self.view.layer addSublayer:emitter];
emitter.renderMode = kCAEmitterLayerAdditive;
emitter.emitterPosition = CGPointMake(emitter.frame.size.width/2, emitter.frame.size.height/2);
CAEmitterCell *cell = [[CAEmitterCell alloc] init];
cell.contents = (__bridge id)[UIImage imageNamed:@"yuandan1"].CGImage;
cell.birthRate = 150;
cell.lifetime = 5;
cell.alphaSpeed = -0.4;
cell.velocity = 50;
cell.velocityRange = 50;
cell.emissionRange = M_PI *2.0;
emitter.emitterCells = @[cell];