public void addSprite()
        {
            // adicionando o sprite ao lazyLayer, centralizado e usando o arquivo .png como  fonte.
            CCSprite sprite = new CCSprite("hand.png");
            sprite.Position = CCDirector.SharedDirector.WinSize.Center;
            // escalona o Sprite para ter metade de seu tamanho nominal
            sprite.Scale = 0.5f;
            // gira o Sprite em 180 graus.
            sprite.Rotation= 180;

            this.AddChild(sprite, 0);

            var rotateToA = new CCRotateTo(1, 360);
            var scaleToA = new CCScaleTo(2, 1, 1);

            // executa uma sequência de ações diretamente no this.sprite
            sprite.RunAction(new CCSequence(rotateToA, scaleToA));
        }
Exemple #2
0
        public override void OnEnter()
        {
            base.OnEnter();

            centerSprites(3);

            var actionTo = new CCRotateTo (2, 45);
            var actionTo2 = new CCRotateTo (2, -45);
            var actionTo0 = new CCRotateTo (2, 0);
            m_tamara.RunAction(new CCSequence(actionTo, actionTo0));

            var actionBy = new CCRotateBy (2, 360);
            var actionByBack = actionBy.Reverse();
            m_grossini.RunAction(new CCSequence(actionBy, actionByBack));

            // m_kathia->runAction( CCSequence::actions(actionTo2, actionTo0->copy()->autorelease(), NULL));
            m_kathia.RunAction(new CCSequence(actionTo2, (CCActionInterval) actionTo0.Copy()));
        }
Exemple #3
0
        public override void OnEnter()
        {

            base.OnEnter();

            m_tamara.RemoveFromParentAndCleanup(true);
            m_grossini.RemoveFromParentAndCleanup(true);
            m_kathia.RemoveFromParentAndCleanup(true);

			// Get window size so that we can center the box layer
			var winSize = CCDirector.SharedDirector.WinSize;

			var boxSize = new CCSize(100.0f, 100.0f);

            var box = new CCLayerColor(new CCColor4B(255, 255, 0, 255));
            box.AnchorPoint = new CCPoint(0, 0);
			box.Position = new CCPoint(winSize.Center.X - (boxSize.Width / 2), winSize.Center.Y - (boxSize.Height / 2));
            box.ContentSize = boxSize;

            var uL = new CCLayerColor(new CCColor4B(255, 0, 0, 255));
            box.AddChild(uL);
            uL.ContentSize = new CCSize(markrside, markrside);
            uL.Position = new CCPoint(0.0f, boxSize.Height - markrside);
            uL.AnchorPoint = new CCPoint(0, 0);

            var uR = new CCLayerColor(new CCColor4B(0, 0, 255, 255));
            box.AddChild(uR);
            uR.ContentSize = new CCSize(markrside, markrside);
            uR.Position = new CCPoint(boxSize.Width - markrside, boxSize.Height - markrside);
            uR.AnchorPoint = new CCPoint(0, 0);
            AddChild(box);

            var actionTo = new CCSkewTo (2, 0.0f, 2.0f);
            var rotateTo = new CCRotateTo (2, 61.0f);
            var actionScaleTo = new CCScaleTo(2, -0.44f, 0.47f);

            var actionScaleToBack = new CCScaleTo(2, 1.0f, 1.0f);
            var rotateToBack = new CCRotateTo (2, 0);
            var actionToBack = new CCSkewTo (2, 0, 0);

            box.RunAction(new CCSequence(actionTo, actionToBack));
            box.RunAction(new CCSequence(rotateTo, rotateToBack));
            box.RunAction(new CCSequence(actionScaleTo, actionScaleToBack));
        }
Exemple #4
0
        public override void OnEnter()
        {
            base.OnEnter();

            centerSprites(3);

            var actionTo = new CCRotateTo(2, 37.2f, -37.2f);
            var actionToBack = new CCRotateTo(2, 0, 0);
            var actionBy = new CCRotateBy(2, 0.0f, -90.0f);
            var actionBy2 = new CCRotateBy(2, 45.0f, 45.0f);
            var actionByBack = (CCRotateBy) actionBy.Reverse();

            m_tamara.RunAction(new CCSequence(actionTo, actionToBack));
            m_grossini.RunAction(new CCSequence(actionBy, actionByBack));

            m_kathia.RunAction(new CCSequence(actionBy2, actionBy2.Reverse()));

            m_tamara.RunAction(new CCSequence(actionTo, actionToBack));
            m_grossini.RunAction(new CCSequence(actionBy, actionByBack));

            m_kathia.RunAction(new CCSequence(actionBy2, actionBy2.Reverse()));
        }
Exemple #5
0
        public override void OnEnter()
        {
            base.OnEnter();

            centerSprites(2);

            var act1 = new CCRotateTo (1, 90);
            var act2 = new CCRotateTo (1, 0);
            var seq = (new CCSequence(act1, act2));
            var rep1 = new CCRepeatForever ((CCActionInterval)seq);
            var rep2 = new CCRepeat ((CCFiniteTimeAction)(seq.Copy()), 10);

            m_tamara.RunAction(rep1);
            m_kathia.RunAction(rep2);
        }