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];
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。