iOS实现爆炸的效果

释放双眼,带上耳机,听听看~!

 

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];

 

人已赞赏
iOS文章

iOS开发网络监听

2019-11-8 6:22:37

iOS文章

IOS获取各种文件目录路径的方法

2019-11-8 17:16:32

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
有新消息 消息中心
搜索