码迷,mamicode.com
首页 > 移动开发 > 详细

爆炸的效果(IOS)

时间:2015-01-05 16:44:42      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:ios

爆炸的效果(IOS)

by 伍雪颖

技术分享

    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

原文地址:http://blog.csdn.net/rainlesvio/article/details/42423065

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!