void InitExplosionParticles() { //BUG: the texture used in the particle system doesn't look correct on Android (probably due to premultiplied setting) explosion = new CCParticleSystemQuad("ExplodingBanana.plist"); explosion.AutoRemoveOnFinish = false; explosion.StopSystem(); explosion.Visible = false; AddChild(explosion); }
void InitExplosionParticles() { explosion = new CCParticleSystemQuad("ExplodingBanana.plist"); explosion.AutoRemoveOnFinish = false; explosion.BlendFunc = CCBlendFunc.Opaque; #if ANDROID //The texture used in the particle system doesn't look correct on Android (probably due to premultiplied setting) // In the ExplodingBanana.plist configuration the Blending Funcion is set for Premulitplied Alpha so // we will overrid it for Android. explosion.BlendFunc = CCBlendFunc.NonPremultiplied; #endif explosion.StopSystem(); explosion.Visible = false; AddChild(explosion); }
private void UpdatePowerPlay() { var powerPlay = (_numConsecutiveGems >= 5); if (powerPlay == _isPowerPlay) { return; } if (powerPlay) { // Start power-play _powerPlayParticles = new CCParticleSystemQuad("Particles/power-play.plist"); _powerPlayParticles.AutoRemoveOnFinish = (true); _powerPlayParticles.SourcePosition = new CCPoint(CCDirector.SharedDirector.WinSize.Width / 2, CCDirector.SharedDirector.WinSize.Height / 2); _powerPlayParticles.PosVar = new CCPoint(CCDirector.SharedDirector.WinSize.Width / 2, CCDirector.SharedDirector.WinSize.Height / 2); _particleLayer.AddChild(_powerPlayParticles); var contentSize = CCDirector.SharedDirector.WinSize; _powerPlayLayer = new CCLayerColor(new CCColor4B(85, 0, 70, 0), contentSize.Width, contentSize.Height); var action = new CCSequence(new CCFadeIn(0.25f), new CCFadeOut(0.25f)); _powerPlayLayer.RunAction(new CCRepeatForever(action)); _powerPlayLayer.BlendFunc = CCBlendFunc.Additive; _effectsLayer.AddChild(_powerPlayLayer); } else { // Stop power-play if (_powerPlayParticles != null) { _powerPlayParticles.StopSystem(); _powerPlayLayer.StopAllActions(); _powerPlayLayer.RunAction(new CCSequence(new CCFadeOut(0.5f), new CCRemoveSelf(true))); } } _isPowerPlay = powerPlay; }