public GroundParticle() { string [] particleData = new [] { "particle_ground.plist" }; MainParticle = new CCParticleSystemQuad (particleData [0]); this.AddChild (MainParticle); LeftRotation = new CCRotateTo (0f, 0f); RightRotation = new CCRotateTo (0f, 180f); }
public void AddParticleSystemQuad(string[] plistFiles, Action<CCParticleSystemQuad> particleInitialization) { CCParticleSystemQuad starsEffect; foreach (var stars in plistFiles) { starsEffect = new CCParticleSystemQuad(stars); if (particleInitialization != null) particleInitialization(starsEffect); AddChild(starsEffect, 1); } }
public CCParticleSystemQuad Clone() { var p = new CCParticleSystemQuad(TotalParticles, EmitterMode); // angle p.Angle = Angle; p.AngleVar = AngleVar; // duration p.Duration = Duration; // blend function p.BlendFunc = BlendFunc; // color p.StartColor = StartColor; p.StartColorVar = StartColorVar; p.EndColor = EndColor; p.EndColorVar = EndColorVar; // particle size p.StartSize = StartSize; p.StartSizeVar = StartSizeVar; p.EndSize = EndSize; p.EndSizeVar = EndSizeVar; // position p.Position = Position; p.PositionVar = PositionVar; // Spinning p.StartSpin = StartSpin; p.StartSpinVar = StartSpinVar; p.EndSpin = EndSpin; p.EndSpinVar = EndSpinVar; p.GravityMode = GravityMode; p.RadialMode = RadialMode; // life span p.Life = Life; p.LifeVar = LifeVar; // emission Rate p.EmissionRate = EmissionRate; p.OpacityModifyRGB = OpacityModifyRGB; p.Texture = Texture; p.AutoRemoveOnFinish = AutoRemoveOnFinish; return(p); }
public override void OnEnter() { base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size; Color = CCColor3B.Black; RemoveChild(Background, true); Background = null; CCParticleSystemQuad emitter1 = new CCParticleSystemQuad("Particles/LavaFlow"); emitter1.StartColor = (new CCColor4F(1, 0, 0, 1)); CCParticleSystemQuad emitter2 = new CCParticleSystemQuad("Particles/LavaFlow"); emitter2.StartColor = (new CCColor4F(0, 1, 0, 1)); CCParticleSystemQuad emitter3 = new CCParticleSystemQuad("Particles/LavaFlow"); emitter3.StartColor = (new CCColor4F(0, 0, 1, 1)); CCSize s = WindowSize; emitter1.Position = (new CCPoint(s.Width / 1.25f, s.Height / 1.25f)); emitter2.Position = (new CCPoint(s.Width / 2, s.Height / 2)); emitter3.Position = (new CCPoint(s.Width / 4, s.Height / 4)); emitter1.Texture = CCTextureCache.SharedTextureCache.AddImage("Images/fire"); emitter2.Texture = emitter1.Texture; emitter3.Texture = emitter1.Texture; CCParticleBatchNode batch = new CCParticleBatchNode(emitter1.Texture); batch.AddChild(emitter1, 0); batch.AddChild(emitter2, 0); batch.AddChild(emitter3, 0); AddChild(batch, 10); }
void ParticleSystemLoaded(CCParticleSystemConfig psConfig) { label.RemoveFromParent(true); CCParticleSystemQuad ignore = new CCParticleSystemQuad (psConfig); //ignore.TotalParticles = 200; CCNode parent1 = new CCNode (); CCParticleBatchNode parent2 = new CCParticleBatchNode (ignore.Texture); parent1.ContentSize = new CCSize (300.0f, 300.0f); for (int i = 0; i < 2; i++) { CCNode parent = (i == 0 ? parent1 : parent2); CCParticleSystemQuad emitter1 = new CCParticleSystemQuad (psConfig); //emitter1.TotalParticles = 200; emitter1.StartColor = (new CCColor4F (1, 0, 0, 1)); emitter1.BlendAdditive = (false); CCParticleSystemQuad emitter2 = new CCParticleSystemQuad (psConfig); //emitter2.TotalParticles = 200; emitter2.StartColor = (new CCColor4F (0, 1, 0, 1)); emitter2.BlendAdditive = (false); CCParticleSystemQuad emitter3 = new CCParticleSystemQuad (psConfig); //emitter3.TotalParticles = 200; emitter3.StartColor = (new CCColor4F (0, 0, 1, 1)); emitter3.BlendAdditive = (false); CCSize s = Layer.VisibleBoundsWorldspace.Size; int neg = (i == 0 ? 1 : -1); emitter1.Position = (new CCPoint (s.Width / 2 - 30, s.Height / 2 + 60 * neg)); emitter2.Position = (new CCPoint (s.Width / 2, s.Height / 2 + 60 * neg)); emitter3.Position = (new CCPoint (s.Width / 2 + 30, s.Height / 2 + 60 * neg)); parent.AddChild (emitter1, 0, 1); parent.AddChild (emitter2, 0, 2); parent.AddChild (emitter3, 0, 3); AddChild (parent, 10, 1000 + i); } Schedule(ReorderParticles, 1.0f); }
public override void OnEnter() { base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size; Color = CCColor3B.Black; RemoveChild(Background, true); Background = null; Emitter = new CCParticleSystemQuad("Particles/LavaFlow"); Emitter.Texture = CCTextureCache.SharedTextureCache.AddImage("Images/fire"); CCParticleBatchNode batch = new CCParticleBatchNode(Emitter.Texture); batch.AddChild(Emitter); AddChild(batch, NODE_ZORDER); Schedule(SwitchRender, 2.0f); CCLayer node = new CCLayer(); AddChild(node, NODE_ZORDER); parent1 = batch; parent2 = node; }
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); }
public override void OnEnter() { base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size; Color = new CCColor3B(0, 0, 0); RemoveChild(Background, true); Background = null; var system = new CCParticleSystemQuad("Particles/SpinningPeas"); system.Texture = (CCTextureCache.SharedTextureCache.AddImage ("Images/particles")); system.TextureRect = new CCRect(0, 0, 32, 32); AddChild(system, 10); Emitter = system; index = 0; Schedule(UpdateQuads, 2.0f); }
public override void OnEnter() { base.OnEnter(); Color = CCColor3B.Black; RemoveChild(Background, true); Background = null; Emitter = new CCParticleSystemQuad("Particles/BoilingFoam"); // Particle Designer "normal" blend func causes black halo on premul textures (ignores multiplication) //this->emitter.blendFunc = (ccBlendFunc){ GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA }; // Cocos2d "normal" blend func for premul causes alpha to be ignored (oversaturates colors) var tBlendFunc = new CCBlendFunc(CCOGLES.GL_ONE, CCOGLES.GL_ONE_MINUS_SRC_ALPHA); Emitter.BlendFunc = tBlendFunc; //Debug.Assert(Emitter.OpacityModifyRGB, "Particle texture does not have premultiplied alpha, test is useless"); // Toggle next line to see old behavior // this->emitter.opacityModifyRGB = NO; Emitter.StartColor = new CCColor4F(1, 1, 1, 1); Emitter.EndColor = new CCColor4F(1, 1, 1, 0); Emitter.StartColorVar = new CCColor4F(0, 0, 0, 0); Emitter.EndColorVar = new CCColor4F(0, 0, 0, 0); AddChild(Emitter, 10); }
public override void OnEnter() { base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size; Emitter = new CCParticleSystemQuad(300); //Emitter.autorelease(); Background.AddChild(Emitter, 10); ////Emitter.release(); // win32 : Remove this line Emitter.Texture = CCTextureCache.SharedTextureCache.AddImage(TestResource.s_stars2); // duration Emitter.Duration = -1; // gravity Emitter.Gravity = (new CCPoint(0, 0)); // angle Emitter.Angle = 90; Emitter.AngleVar = 360; // speed of particles Emitter.Speed = (160); Emitter.SpeedVar = (20); // radial Emitter.RadialAccel = (-120); Emitter.RadialAccelVar = (0); // tagential Emitter.TangentialAccel = (30); Emitter.TangentialAccelVar = (0); // emitter position Emitter.Position = new CCPoint(160, 240); Emitter.PositionVar = new CCPoint(0, 0); // life of particles Emitter.Life = 3; Emitter.LifeVar = 1; // spin of particles Emitter.StartSpin = 0; Emitter.StartSpinVar = 0; Emitter.EndSpin = 0; Emitter.EndSpinVar = 2000; // color of particles var startColor = new CCColor4F(0.5f, 0.5f, 0.5f, 1.0f); Emitter.StartColor = startColor; var startColorVar = new CCColor4F(0.5f, 0.5f, 0.5f, 1.0f); Emitter.StartColorVar = startColorVar; var endColor = new CCColor4F(0.1f, 0.1f, 0.1f, 0.2f); Emitter.EndColor = endColor; var endColorVar = new CCColor4F(0.1f, 0.1f, 0.1f, 0.2f); Emitter.EndColorVar = endColorVar; // size, in pixels Emitter.StartSize = 30.0f; Emitter.StartSizeVar = 00.0f; Emitter.EndSize = CCParticleSystem.ParticleStartSizeEqualToEndSize; // emits per second Emitter.EmissionRate = Emitter.TotalParticles / Emitter.Life; // additive Emitter.BlendAdditive = false; SetEmitterPosition(); }
public override void OnEnter() { base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size; Color = CCColor3B.Black; RemoveChild(Background, true); Background = null; CCParticleBatchNode batchNode = new CCParticleBatchNode("Images/fire", 3000); AddChild(batchNode, 1, 2); for (int i = 0; i < 5; i++) { CCParticleSystemQuad particleSystem = new CCParticleSystemQuad("Particles/SpinningPeas"); particleSystem.PositionType = CCPositionType.Grouped; particleSystem.Position = (new CCPoint(i * 50, i * 50)); particleSystem.Texture = batchNode.Texture; batchNode.AddChild(particleSystem); } Emitter = null; }
void RemoveSystem(float dt) { int nChildrenCount = batchNode.ChildrenCount; if (nChildrenCount > 0) { CCLog.Log("remove random system"); int uRand = CCRandom.Next(nChildrenCount - 1); batchNode.RemoveChild(batchNode.Children[uRand], true); CCParticleSystemQuad particleSystem = new CCParticleSystemQuad("Particles/Spiral"); //add new particleSystem.PositionType = CCPositionType.Grouped; particleSystem.TotalParticles = (200); particleSystem.Position = (new CCPoint(CCRandom.Next(300), CCRandom.Next(400))); CCLog.Log("add a new system"); int randZ = CCRandom.Next(100); particleSystem.Texture = batchNode.Texture; batchNode.AddChild(particleSystem, randZ, -1); } }
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); }
public void createParticleSystem() { CCParticleSystem particleSystem = null; /* * Tests: * 1: Point Particle System using 32-bit textures (PNG) * 2: Point Particle System using 16-bit textures (PNG) * 3: Point Particle System using 8-bit textures (PNG) * 4: Point Particle System using 4-bit textures (PVRTC) * 5: Quad Particle System using 32-bit textures (PNG) * 6: Quad Particle System using 16-bit textures (PNG) * 7: Quad Particle System using 8-bit textures (PNG) * 8: Quad Particle System using 4-bit textures (PVRTC) */ RemoveChildByTag(PerformanceParticleTest.kTagParticleSystem, true); // remove the "fire.png" from the TextureCache cache. CCTexture2D texture = CCTextureCache.SharedTextureCache.AddImage("Images/fire"); CCTextureCache.SharedTextureCache.RemoveTexture(texture); particleSystem = new CCParticleSystemQuad(quantityParticles); switch (subtestNumber) { case 1: CCTexture2D.DefaultAlphaPixelFormat = CCSurfaceFormat.Color; particleSystem.Texture = CCTextureCache.SharedTextureCache.AddImage("Images/fire"); break; case 2: CCTexture2D.DefaultAlphaPixelFormat = CCSurfaceFormat.Bgra4444; particleSystem.Texture = CCTextureCache.SharedTextureCache.AddImage("Images/fire"); break; case 3: CCTexture2D.DefaultAlphaPixelFormat = CCSurfaceFormat.Alpha8; particleSystem.Texture = CCTextureCache.SharedTextureCache.AddImage("Images/fire"); break; // case 4: // particleSystem->initWithTotalParticles(quantityParticles); // ////---- particleSystem.texture = [[CCTextureCache sharedTextureCache] addImage:@"fire.pvr"]; // particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("Images/fire.png")); // break; case 4: CCTexture2D.DefaultAlphaPixelFormat = CCSurfaceFormat.Color; particleSystem.Texture = CCTextureCache.SharedTextureCache.AddImage("Images/fire"); break; case 5: CCTexture2D.DefaultAlphaPixelFormat = CCSurfaceFormat.Bgra4444; particleSystem.Texture = CCTextureCache.SharedTextureCache.AddImage("Images/fire"); break; case 6: CCTexture2D.DefaultAlphaPixelFormat = CCSurfaceFormat.Alpha8; particleSystem.Texture = CCTextureCache.SharedTextureCache.AddImage("Images/fire"); break; // case 8: // particleSystem->initWithTotalParticles(quantityParticles); // ////---- particleSystem.texture = [[CCTextureCache sharedTextureCache] addImage:@"fire.pvr"]; // particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("Images/fire.png")); // break; default: particleSystem = null; CCLog.Log("Shall not happen!"); break; } AddChild(particleSystem, 0, PerformanceParticleTest.kTagParticleSystem); doTest(); // restore the default pixel format CCTexture2D.DefaultAlphaPixelFormat = CCSurfaceFormat.Color; }
public override void OnEnter() { base.OnEnter(); Color = CCColor3B.Black; RemoveChild(Background, true); Background = null; Emitter = new CCParticleSystemQuad("Particles/TestPremultipliedAlpha"); AddChild(Emitter, 10); }
public override void OnEnter() { base.OnEnter(); Color = CCColor3B.Black; RemoveChild(Background, true); Background = null; for (int i = 0; i < 6; i++) { CCParticleSystemQuad particleSystem = new CCParticleSystemQuad("Particles/Spiral"); particleSystem.PositionType = CCPositionType.Grouped; particleSystem.TotalParticles = 200; particleSystem.Position = (new CCPoint(i * 15 + 100, i * 15 + 100)); int randZ = CCRandom.Next(100); } Schedule(RemoveSystem, 0.5f); Emitter = null; }
public override void OnEnter() { base.OnEnter(); Color = CCColor3B.Black; RemoveChild(Background, true); Background = null; for (int i = 0; i < 5; i++) { CCParticleSystemQuad particleSystem = new CCParticleSystemQuad("Particles/SpinningPeas"); particleSystem.PositionType = CCPositionType.Grouped; particleSystem.Position = (new CCPoint(i * 50, i * 50)); } Emitter = null; }
public override void OnEnter() { base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size; Color = CCColor3B.Black; RemoveChild(Background, true); Background = null; //adds the texture inside the plist to the texture cache batchNode = new CCParticleBatchNode("Images/fire", 16000); AddChild(batchNode, 1, 2); for (int i = 0; i < 6; i++) { CCParticleSystemQuad particleSystem = new CCParticleSystemQuad("Particles/Spiral"); particleSystem.Texture = batchNode.Texture; particleSystem.PositionType = CCPositionType.Grouped; particleSystem.TotalParticles = (200); particleSystem.Position = (new CCPoint(i * 15 + 100, i * 15 + 100)); int randZ = CCRandom.Next(100); batchNode.AddChild(particleSystem, randZ, -1); } Schedule(RemoveSystem, 0.5f); Emitter = null; }
public CCParticleSystemQuad Clone() { var p = new CCParticleSystemQuad(TotalParticles, EmitterMode); // angle p.Angle = Angle; p.AngleVar = AngleVar; // duration p.Duration = Duration; // blend function p.BlendFunc = BlendFunc; // color p.StartColor = StartColor; p.StartColorVar = StartColorVar; p.EndColor = EndColor; p.EndColorVar = EndColorVar; // particle size p.StartSize = StartSize; p.StartSizeVar = StartSizeVar; p.EndSize = EndSize; p.EndSizeVar = EndSizeVar; // position p.Position = Position; p.PositionVar = PositionVar; // Spinning p.StartSpin = StartSpin; p.StartSpinVar = StartSpinVar; p.EndSpin = EndSpin; p.EndSpinVar = EndSpinVar; p.GravityMode = GravityMode; p.RadialMode = RadialMode; // life span p.Life = Life; p.LifeVar = LifeVar; // emission Rate p.EmissionRate = EmissionRate; p.OpacityModifyRGB = OpacityModifyRGB; p.Texture = Texture; p.AutoRemoveOnFinish = AutoRemoveOnFinish; return p; }
public override void OnEnter() { base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size; Color = CCColor3B.Black; RemoveChild(Background, true); Background = null; batchNode = new CCParticleBatchNode("Images/stars-grayscale", 3000); AddChild(batchNode, 1, 2); for (int i = 0; i < 3; i++) { var particleSystem = new CCParticleSystemQuad(200, CCEmitterMode.Radius); particleSystem.Texture = (batchNode.Texture); // duration particleSystem.Duration = CCParticleSystem.ParticleDurationInfinity; // radius mode: 100 pixels from center particleSystem.StartRadius = (100); particleSystem.StartRadiusVar = (0); particleSystem.EndRadius = (CCParticleSystem.ParticleStartRadiusEqualToEndRadius); particleSystem.EndRadiusVar = (0); // not used when start == end // radius mode: degrees per second // 45 * 4 seconds of life = 180 degrees particleSystem.RotatePerSecond = (45); particleSystem.RotatePerSecondVar = (0); // angle particleSystem.Angle = (90); particleSystem.AngleVar = (0); // emitter position particleSystem.PositionVar = (CCPoint.Zero); // life of particles particleSystem.Life = (4); particleSystem.LifeVar = (0); // spin of particles particleSystem.StartSpin = (0); particleSystem.StartSpinVar = (0); particleSystem.EndSpin = (0); particleSystem.EndSpinVar = (0); // color of particles var color = new float[3] {0, 0, 0}; color[i] = 1; var startColor = new CCColor4F(color[0], color[1], color[2], 1.0f); particleSystem.StartColor = (startColor); var startColorVar = new CCColor4F(0, 0, 0, 0); particleSystem.StartColorVar = (startColorVar); CCColor4F endColor = startColor; particleSystem.EndColor = (endColor); CCColor4F endColorVar = startColorVar; particleSystem.EndColorVar = (endColorVar); // size, in pixels particleSystem.StartSize = (32); particleSystem.StartSizeVar = (0); particleSystem.EndSize = CCParticleSystem.ParticleStartSizeEqualToEndSize; // emits per second particleSystem.EmissionRate = (particleSystem.TotalParticles / particleSystem.Life); // additive particleSystem.Position = (new CCPoint(i * 10 + 120, 200)); batchNode.AddChild(particleSystem); particleSystem.PositionType = CCPositionType.Free; } Schedule(ReorderSystem, 2.0f); Emitter = null; }
public override void OnEnter() { base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size; Color = new CCColor3B(0, 0, 0); RemoveChild(Background, true); Background = null; string filename = "Particles/" + title; CCParticleSystemConfig config; if (particleConfigManager.ContainsKey (filename)) config = particleConfigManager [filename]; else { config = new CCParticleSystemConfig(filename, null); particleConfigManager.Add (filename, config); } Emitter = new CCParticleSystemQuad(config); AddChild(Emitter, 10); Emitter.BlendAdditive = true; SetEmitterPosition(); }
public override void OnEnter() { base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size; Color = CCColor3B.Black; RemoveChild(Background, true); Background = null; Emitter = new CCParticleSystemQuad("Particles/TestPremultipliedAlpha"); AddChild(Emitter, 10); }
public override void OnEnter() { base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size; Color = new CCColor3B(0, 0, 0); RemoveChild(Background, true); Background = null; Emitter = new CCParticleSystemQuad(100, CCEmitterMode.Radius); AddChild(Emitter, 10); Emitter.Texture = CCTextureCache.SharedTextureCache.AddImage("Images/fire"); // duration Emitter.Duration = CCParticleSystem.ParticleDurationInfinity; // radius mode: start and end radius in pixels Emitter.StartRadius = (50); Emitter.StartRadiusVar = (0); Emitter.EndRadius = (CCParticleSystem.ParticleStartRadiusEqualToEndRadius); Emitter.EndRadiusVar = (0); // radius mode: degrees per second Emitter.RotatePerSecond = (0); Emitter.RotatePerSecondVar = (0); // angle Emitter.Angle = 90; Emitter.AngleVar = 0; // emitter position CCSize size = WindowSize; Emitter.Position = new CCPoint(size.Width / 2, size.Height / 2); Emitter.PositionVar = new CCPoint(0, 0); // life of particles Emitter.Life = 5; Emitter.LifeVar = 0; // spin of particles Emitter.StartSpin = 0; Emitter.StartSpinVar = 0; Emitter.EndSpin = 0; Emitter.EndSpinVar = 0; // color of particles var startColor = new CCColor4F(0.5f, 0.5f, 0.5f, 1.0f); Emitter.StartColor = startColor; var startColorVar = new CCColor4F(0.5f, 0.5f, 0.5f, 1.0f); Emitter.StartColorVar = startColorVar; var endColor = new CCColor4F(0.1f, 0.1f, 0.1f, 0.2f); Emitter.EndColor = endColor; var endColorVar = new CCColor4F(0.1f, 0.1f, 0.1f, 0.2f); Emitter.EndColorVar = endColorVar; // size, in pixels Emitter.StartSize = 16; Emitter.StartSizeVar = 0; Emitter.EndSize = CCParticleSystem.ParticleStartSizeEqualToEndSize; // emits per second Emitter.EmissionRate = Emitter.TotalParticles / Emitter.Life; // additive Emitter.BlendAdditive = false; CCRotateBy rot = new CCRotateBy (16, 360); Emitter.RunAction(new CCRepeatForever (rot)); }
public override void OnEnter() { base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size; Emitter = new CCParticleSystemQuad(1000); Background.AddChild(Emitter, 10); CCSize s = windowSize; // duration Emitter.Duration = -1; // gravity Emitter.Gravity = (new CCPoint(0, 0)); // angle Emitter.Angle = 0; Emitter.AngleVar = 360; // radial Emitter.RadialAccel = (70); Emitter.RadialAccelVar = (10); // tagential Emitter.TangentialAccel = (80); Emitter.TangentialAccelVar = (0); // speed of particles Emitter.Speed = (50); Emitter.SpeedVar = (10); // emitter position Emitter.Position = new CCPoint(s.Width / 2, s.Height / 2); Emitter.PositionVar = new CCPoint(0, 0); // life of particles Emitter.Life = 2.0f; Emitter.LifeVar = 0.3f; // emits per frame Emitter.EmissionRate = Emitter.TotalParticles / Emitter.Life; // color of particles var startColor = new CCColor4F(0.5f, 0.5f, 0.5f, 1.0f); Emitter.StartColor = startColor; var startColorVar = new CCColor4F(0.5f, 0.5f, 0.5f, 1.0f); Emitter.StartColorVar = startColorVar; var endColor = new CCColor4F(0.1f, 0.1f, 0.1f, 0.2f); Emitter.EndColor = endColor; var endColorVar = new CCColor4F(0.1f, 0.1f, 0.1f, 0.2f); Emitter.EndColorVar = endColorVar; // size, in pixels Emitter.StartSize = 1.0f; Emitter.StartSizeVar = 1.0f; Emitter.EndSize = 32.0f; Emitter.EndSizeVar = 8.0f; // texture Emitter.Texture = CCTextureCache.SharedTextureCache.AddImage(TestResource.s_fire); // additive Emitter.BlendAdditive = false; SetEmitterPosition(); }
void Explode(CCPoint pt) { string[] effectArray = {"exp1.plist", "boom.plist", "starTest.plist"}; // string[] effectArray = {"exp1.plist"}; foreach (var effectName in effectArray) { var effect = new CCParticleSystemQuad (effectName); effect.Position = pt; AddChild (effect, 10000); } return; var explosion = new CCParticleExplosion (pt); //TODO: manage "better" for performance when "many" particles explosion.TotalParticles = 10; explosion.AutoRemoveOnFinish = true; AddChild (explosion); }