这是我在CCTouchesMoved中用于在触摸位置产生粒子效果的代码。但是在使用这种FPS的同时,触摸正在向下移动到20!我已经尝试降低粒子的寿命和持续时间(你可以在代码中看到).....在CCTouchesMoved中使用Cocos2D粒子效果时FPS降低问题
如何解决FPS降低触摸问题,同时使用粒子效应?
- (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
location = [touch locationInView:[touch view]];
location = [[CCDirector sharedDirector] convertToGL:location];
swipeEffect = [CCParticleSystemQuad particleWithFile:@"comet.plist"];
//Setting some parameters for the effect
swipeEffect.position = ccp(location.x, location.y);
//For fixing the FPS issue I deliberately lowered the life & duration
swipeEffect.life =0.0000000001;
swipeEffect.duration = 0.0000000001;
//Adding and removing after effects
[self addChild:swipeEffect];
swipeEffect.autoRemoveOnFinish=YES;
}
请帮我...我试着用不同的颗粒&最大限度地减少生命和持续时间,但没有工作! 任何新的想法?或修复我所做的事情?
您使用模拟器? – xuanweng 2011-04-07 01:53:06
@ xuanweng->我试了模拟器和设备。工作原理相同。 FPS在接触移动时显示约20。应用DID不是崩溃,但FPS降低。 – ShinuShajahan 2011-04-07 07:43:15