Exemple #1
0
        public static CCRotateTo actionWithDuration(float duration, float fDeltaAngle)
        {
            CCRotateTo cCRotateTo = new CCRotateTo();

            cCRotateTo.initWithDuration(duration, fDeltaAngle);
            return(cCRotateTo);
        }
Exemple #2
0
        public override CCObject copyWithZone(CCZone zone)
        {
            CCZone     cCZone     = zone;
            CCRotateTo cCRotateTo = null;

            if (cCZone == null || cCZone.m_pCopyObject == null)
            {
                cCRotateTo = new CCRotateTo();
                cCZone     = new CCZone(cCRotateTo);
            }
            else
            {
                cCRotateTo = cCZone.m_pCopyObject as CCRotateTo;
                if (cCRotateTo == null)
                {
                    return(null);
                }
            }
            base.copyWithZone(cCZone);
            cCRotateTo.initWithDuration(this.m_fDuration, this.m_fDstAngle);
            return(cCRotateTo);
        }
Exemple #3
0
 public override void startWithTarget(CCNode target)
 {
     base.startWithTarget(target);
     this.m_fStartAngle = target.rotation;
     if (this.m_fStartAngle <= 0f)
     {
         this.m_fStartAngle = this.m_fStartAngle % -360f;
     }
     else
     {
         this.m_fStartAngle = this.m_fStartAngle % 350f;
     }
     this.m_fDiffAngle = this.m_fDstAngle - this.m_fStartAngle;
     if (this.m_fDiffAngle > 180f)
     {
         CCRotateTo mFDiffAngle = this;
         mFDiffAngle.m_fDiffAngle = mFDiffAngle.m_fDiffAngle - 360f;
     }
     if (this.m_fDiffAngle < -180f)
     {
         CCRotateTo cCRotateTo = this;
         cCRotateTo.m_fDiffAngle = cCRotateTo.m_fDiffAngle + 360f;
     }
 }
Exemple #4
0
        public override void OnEnter()
        {
            base.OnEnter();

            centerSprites(2);

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

            m_tamara.RunAction(rep1);
            m_kathia.RunAction(rep2);
        }
Exemple #5
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(CCSequence.FromActions(actionTo, actionTo0));

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

            // m_kathia->runAction( CCSequence::actions(actionTo2, actionTo0->copy()->autorelease(), NULL));
            m_kathia.RunAction(CCSequence.FromActions(actionTo2, (CCActionInterval) actionTo0.Copy()));
        }
Exemple #6
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(CCSequence.FromActions(actionTo, actionToBack));
            box.RunAction(CCSequence.FromActions(rotateTo, rotateToBack));
            box.RunAction(CCSequence.FromActions(actionScaleTo, actionScaleToBack));
        }