Пример #1
0
        public override void onEnter()
        {
            base.onEnter();

            m_emitter = CCParticleGalaxy.node();
            m_background.addChild(m_emitter, 10);

            m_emitter.Texture = CCTextureCache.sharedTextureCache().addImage(TestResource.s_fire);

            setEmitterPosition();
        }
Пример #2
0
        private void SetBackground(CCRect bounds, string backgroundImage)
        {
            var bg = new CCSprite(backgroundImage);

            bg.ContentSize = new CCSize(bounds.MaxX, bounds.MaxY);
            bg.Position    = bounds.Center;
            AddChild(bg);

            // test -------
            var topOfscreen = bounds.Center.Offset(0f, bounds.MaxY / 2f);
            var meteor      = new CCParticleMeteor(new CCPoint(-500, 2000));
            var moveTo      = new CCMoveTo(3.0f, new CCPoint(bounds.MaxX + 500, -300));
            var seq         = new CCSequence(new CCEaseOut(moveTo, 2), new CCMoveTo(5, moveTo.PositionEnd), new CCMoveTo(0, new CCPoint(-500, 2000)));

            meteor.RunAction(new CCRepeatForever(seq));
            AddChild(meteor);

            var galaxy = new CCParticleGalaxy(topOfscreen.Offset(200.0f, -100.0f));

            AddChild(galaxy);
            // ------------
        }
Пример #3
0
 public static new CCParticleGalaxy Create()
 {
     var ret = new CCParticleGalaxy();
     ret.InitWithTotalParticles(200);
     return ret;
 }