iOS 6和iOS 7上的粒子系统看起来不同

我的应用程序中有几个粒子系统,我最初用ios7在iPad 3上进行了检查。 粒子的外观和performance与我预期的一样,但是当我使用ios6在iPad2上testing时。 颗粒向上移动并变小。 我有一个子类的粒子。 这是我的一个粒子系统的代码。 如果CGREctMake将粒子定位在非视网膜显示器上的不同区域,我正在游荡,但是当我将其他东西放在显示器上时,不会发生这种情况。

代码来调用粒子。

- (void)ShowSteamEffect { //Create view for Steam particle effect. CGRect SteamFrame = CGRectMake(790, 380, 100, 100); //Show Steam effect ShowSteam = [[SteamEffect alloc]initWithFrame:SteamFrame]; ShowSteam.hidden = NO; [self.view insertSubview:ShowSteam aboveSubview:imgComputerLights]; } Steam subclass. #import "SteamEffect.h" @implementation SteamEffect { CAEmitterLayer* SteamEmitter; } - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { // Initialization code SteamEmitter = (CAEmitterLayer*) self.layer; //SteamEmitter.emitterPosition= CGPointMake(0, 0); //SteamEmitter.emitterSize = CGSizeMake(10,10); CAEmitterCell* Steam = [CAEmitterCell emitterCell]; Steam.birthRate = 50; Steam.spin = .6; Steam.lifetime = 1.7; Steam.alphaRange = 0.2; Steam.alphaSpeed = 0.2; Steam.contents = (id)[[UIImage imageNamed:@"Steam1.png"]CGImage]; Steam.velocity = 30; Steam.velocityRange = 50; Steam.emissionLongitude = -60; Steam.emissionRange = M_1_PI; Steam.scale = .2; Steam.scaleSpeed = .5; Steam.yAcceleration = -200; SteamEmitter.renderMode = kCAEmitterLayerBackToFront; SteamEmitter.emitterShape = kCAEmitterLayerCircle; SteamEmitter.emitterCells = @[Steam]; } return self; } -(void)didMoveToSuperview { [super didMoveToSuperview]; if (self.superview==nil) return; [self performSelector:@selector(disableEmitterCell) withObject:nil afterDelay:0.5]; } -(void)disableEmitterCell { [SteamEmitter setValue:@0 forKeyPath:@"birthRate"]; } + (Class) layerClass { //tell UIView to use the CAEmitterLayer root class return [CAEmitterLayer class]; } - (void) setEmitterPosition:(CGPoint)pos { SteamEmitter.emitterPosition = pos; } - (void) toggleOn:(bool)on { //SteamEmitter.birthRate = on? 300 : 0; } 

Interesting Posts