public HelloCocos2dScene() { //var sp = new Sprite(); ////sp.Texture = new Texture(colors, 100, 100); //sp.Texture = new Texture("Content/android9.png"); //sp.Scale = 0.2f; //var size = Director.SharedDirector.DisplaySize; //sp.Position = new CCPoint(size.Width / 2, size.Height / 2); //this.addChild(sp); //var act = new CCRotateBy(); //act.initWithDuration(3.0f, 360); //var jump1 = CCJumpTo.actionWithDuration(5, new CCPoint(500, 0), 80, 10); //var jump2 = CCReverseTime.actionWithAction(jump1); //var quence = CCSequence.actionOneTwo(jump1, jump2); //var spawn = CCSpawn.actionOneTwo(act, quence); //var repeat = new CCRepeatForever(); //repeat.initWithAction(spawn); //sp.RunAction(repeat); CCParticleSnow particle = new CCParticleSnow(); //particle.initWithFile("particle_texture.plist"); particle.Position = Director.SharedDirector.DisplaySize.Center; this.addChild(particle); }
public static new CCParticleSnow node() { CCParticleSnow cCParticleSnow = new CCParticleSnow(); if (cCParticleSnow.init()) { return(cCParticleSnow); } return(null); }
public static CCParticleSnow node() { CCParticleSnow pRet = new CCParticleSnow(); if (pRet.init()) { return(pRet); } return(null); }
public static CCParticleSnow node() { CCParticleSnow pRet = new CCParticleSnow(); if (pRet.init()) { return pRet; } return null; }
public override void OnEnter() { base.OnEnter(); m_emitter = new CCParticleSnow(); m_background.AddChild(m_emitter, 10); CCPoint p = m_emitter.Position; m_emitter.Position = new CCPoint(p.X, p.Y - 110); m_emitter.Life = 3; m_emitter.LifeVar = 1; // gravity m_emitter.Gravity = (new CCPoint(0, -10)); // speed of particles m_emitter.Speed = (130); m_emitter.SpeedVar = (30); var startColor = m_emitter.StartColor; startColor.R = 0.9f; startColor.G = 0.9f; startColor.B = 0.9f; m_emitter.StartColor = startColor; var startColorVar = m_emitter.StartColorVar; startColorVar.B = 0.1f; m_emitter.StartColorVar = startColorVar; m_emitter.EmissionRate = m_emitter.TotalParticles / m_emitter.Life; m_emitter.Texture = CCTextureCache.SharedTextureCache.AddImage(TestResource.s_snow); setEmitterPosition(); }