CAEmitterCell

-( void )awakeFromNib
{
  CAEmitterLayer* fireEmitter = (CAEmitterLayer*) self .layer; ;
     fireEmitter.emitterPosition = CGPointMake ( self .bounds.size.width/ 2 , self .bounds.size.height);
     fireEmitter.emitterMode =   kCAEmitterLayerOutline;
     fireEmitter.emitterShape = kCAEmitterLayerLine;
 
     fireEmitter.emitterSize = CGSizeMake ( self .bounds.size.width/ 5 , self .bounds.size.width/ 5 );
 
     float gas= .7 ;
     // Create the fire emitter cell
     CAEmitterCell *fire = [CAEmitterCell emitterCell];
     fire.emissionLongitude = M_PI ;
     fire.emissionLatitude = - M_PI / 2 ;
     fire.BirthRate = 0 ; //100*gas;
     fire.lifetime=gas;
     fire.lifetimeRange=gas* 0 .35 ;
     fire.Velocity = 80 ;
     fire.VelocityRange = 21 ;
     fire.EmissionRange = 1 .1 f;
     fire.yAcceleration = - 200 ;
     fire.ScaleSpeed = 0 .3 f;
     fire.color=[[ UIColor colorWithRed: 0 .8 green: 0 .4 blue: 0 .2 alpha: 0 .1 ] CGColor ];
     fire.contents = ( id )[[ UIImage imageNamed: @"fire.png" ] CGImage ];
     [fire setName: @"fire" ];
 
     CAEmitterCell *smoke = [CAEmitterCell emitterCell];
     smoke.BirthRate = 0 ; //11;
     smoke.emissionLongitude = - M_PI ;
     smoke.emissionLatitude=- M_PI ;
     smoke.lifetime = gas* 4 ;
     smoke.Velocity = 40 ;
     smoke.VelocityRange = 20 ;
     smoke.emissionRange = M_PI / 4 ;
     smoke.Spin = 1 ;
     smoke.SpinRange = 6 ;
     smoke.yAcceleration = - 160 ;
     smoke.Scale = 0 .1 f;
     smoke.AlphaSpeed = - 0 .22 f;
     smoke.ScaleSpeed = 0 .7 f;
     smoke.color=[[ UIColor colorWithRed: 1 green: 1 blue: 1 alpha: 0 .3 *gas] CGColor ];
 
     smoke.contents = ( id )[[ UIImage imageNamed: @"smoke.png" ] CGImage ];
     [smoke setName: @"smoke" ];
 
     fireEmitter.emitterCells = [ NSArray arrayWithObjects:smoke,fire, nil ];
}


You can download Hanukkah Menorah on the app store now for FREE. It supports both the iPad and iPhone. It also has some In-App-Purchases to change from the default menorah.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值