我的iphone模拟器上有一个粒子系统,但有一个问题。我正在创建一个纸牌游戏,并希望在卡片下面具有粒子效果,目前粒子重叠并且在显示器上看起来不那么好的卡片。 我如何达到预期的效果?
这是我在init部分的代码
- (id)init {
if((self = [super init])) {
CGSize winSize = [CCDirector sharedDirector].winSize;
**[self configureEmitter];**
[CCTexture2D setDefaultAlphaPixelFormat:kCCTexture2DPixelFormat_RGB565];
background = [CCSprite spriteWithFile:@"myBackground.png"];
background.anchorPoint = ccp(0,0);
[self addChild:background];
[CCTexture2D setDefaultAlphaPixelFormat:kCCTexture2DPixelFormat_Default];
}
[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
return self;
}
- (void)configureEmitter {
self.emitter = [[CCParticleSystemQuad alloc] initWithTotalParticles:100];
self.emitter.texture = [[CCTextureCache sharedTextureCache] addImage: @"particlespng"];
[self.emitter setEmitterMode:kCCParticleModeGravity];
emitter.duration = -1;
emitter.gravity = ccp(-200, -80);
}