예제 #1
0
        public static CCBezierBy actionWithDuration(float t, ccBezierConfig c)
        {
            CCBezierBy ret = new CCBezierBy();
            ret.initWithDuration(t, c);

            return ret;
        }
예제 #2
0
        public override CCObject copyWithZone(CCZone zone)
        {
            CCZone     tmpZone = zone;
            CCBezierBy ret     = null;

            if (tmpZone != null && tmpZone.m_pCopyObject != null)
            {
                ret = tmpZone.m_pCopyObject as CCBezierBy;
                if (ret == null)
                {
                    return(null);
                }
            }
            else
            {
                ret     = new CCBezierBy();
                tmpZone = new CCZone(ret);
            }

            base.copyWithZone(tmpZone);

            ret.initWithDuration(m_fDuration, m_sConfig);

            return(ret);
        }
예제 #3
0
        public override CCObject copyWithZone(CCZone zone)
        {
            CCZone tmpZone = zone;
            CCBezierBy ret = null;

            if (tmpZone != null && tmpZone.m_pCopyObject != null)
            {
                ret = tmpZone.m_pCopyObject as CCBezierBy;
                if (ret == null)
                {
                    return null;
                }
            }
            else
            {
                ret = new CCBezierBy();
                tmpZone = new CCZone(ret);
            }

            base.copyWithZone(tmpZone);

            ret.initWithDuration(m_fDuration, m_sConfig);

            return ret;
        }
예제 #4
0
        public static CCBezierBy actionWithDuration(float t, ccBezierConfig c)
        {
            CCBezierBy cCBezierBy = new CCBezierBy();

            cCBezierBy.initWithDuration(t, c);
            return(cCBezierBy);
        }
예제 #5
0
        public static CCBezierBy actionWithDuration(float t, ccBezierConfig c)
        {
            CCBezierBy ret = new CCBezierBy();

            ret.initWithDuration(t, c);

            return(ret);
        }
예제 #6
0
        public override CCFiniteTimeAction reverse()
        {
            ccBezierConfig _ccBezierConfig = new ccBezierConfig();

            _ccBezierConfig.endPosition    = CCPointExtension.ccpNeg(this.m_sConfig.endPosition);
            _ccBezierConfig.controlPoint_1 = CCPointExtension.ccpAdd(this.m_sConfig.controlPoint_2, CCPointExtension.ccpNeg(this.m_sConfig.endPosition));
            _ccBezierConfig.controlPoint_2 = CCPointExtension.ccpAdd(this.m_sConfig.controlPoint_1, CCPointExtension.ccpNeg(this.m_sConfig.endPosition));
            return(CCBezierBy.actionWithDuration(this.m_fDuration, _ccBezierConfig));
        }
예제 #7
0
        public override CCFiniteTimeAction Reverse()
        {
            ccBezierConfig r;

            r.EndPosition = -m_sConfig.EndPosition;
            r.ControlPoint1 = m_sConfig.ControlPoint2 + -m_sConfig.EndPosition;
            r.ControlPoint2 = m_sConfig.ControlPoint1 + -m_sConfig.EndPosition;

            var action = new CCBezierBy(m_fDuration, r);
            return action;
        }
예제 #8
0
        public override CCFiniteTimeAction Reverse()
        {
            ccBezierConfig r;

            r.EndPosition = CCPointExtension.Negative(m_sConfig.EndPosition);
            r.ControlPoint1 = CCPointExtension.Add(m_sConfig.ControlPoint2, CCPointExtension.Negative(m_sConfig.EndPosition));
            r.ControlPoint2 = CCPointExtension.Add(m_sConfig.ControlPoint1, CCPointExtension.Negative(m_sConfig.EndPosition));

            var action = new CCBezierBy(m_fDuration, r);
            return action;
        }
예제 #9
0
        public override CCFiniteTimeAction reverse()
        {
            ccBezierConfig r;

            r.endPosition    = CCPointExtension.ccpNeg(m_sConfig.endPosition);
            r.controlPoint_1 = CCPointExtension.ccpAdd(m_sConfig.controlPoint_2, CCPointExtension.ccpNeg(m_sConfig.endPosition));
            r.controlPoint_2 = CCPointExtension.ccpAdd(m_sConfig.controlPoint_1, CCPointExtension.ccpNeg(m_sConfig.endPosition));

            CCBezierBy action = CCBezierBy.actionWithDuration(m_fDuration, r);

            return(action);
        }
예제 #10
0
        public override CCObject copyWithZone(CCZone zone)
        {
            CCZone     cCZone     = zone;
            CCBezierBy cCBezierBy = null;

            if (cCZone == null || cCZone.m_pCopyObject == null)
            {
                cCBezierBy = new CCBezierBy();
                cCZone     = new CCZone(cCBezierBy);
            }
            else
            {
                cCBezierBy = cCZone.m_pCopyObject as CCBezierBy;
                if (cCBezierBy == null)
                {
                    return(null);
                }
            }
            base.copyWithZone(cCZone);
            cCBezierBy.initWithDuration(this.m_fDuration, this.m_sConfig);
            return(cCBezierBy);
        }
예제 #11
0
 protected CCBezierBy(CCBezierBy bezierBy)
     : base(bezierBy)
 {
     InitWithDuration(bezierBy.m_fDuration, bezierBy.m_sConfig);
 }
예제 #12
0
        public override void OnEnter()
        {
            base.OnEnter();

            var s = CCDirector.SharedDirector.WinSize;

            //
            // startPosition can be any coordinate, but since the movement
            // is relative to the Bezier curve, make it (0,0)
            //

            centerSprites(3);

            // sprite 1
            ccBezierConfig bezier;
            bezier.ControlPoint1 = new CCPoint(0, s.Height / 2);
            bezier.ControlPoint2 = new CCPoint(300, -s.Height / 2);
            bezier.EndPosition = new CCPoint(300, 100);

            var bezierForward = new CCBezierBy (3, bezier);
            var bezierBack = bezierForward.Reverse();
            var rep = new CCRepeatForever ((CCActionInterval)CCSequence.FromActions(bezierForward, bezierBack));

            // sprite 2
            m_tamara.Position = new CCPoint(80, 160);
            ccBezierConfig bezier2;
            bezier2.ControlPoint1 = new CCPoint(100, s.Height / 2);
            bezier2.ControlPoint2 = new CCPoint(200, -s.Height / 2);
            bezier2.EndPosition = new CCPoint(240, 160);

            var bezierTo1 = new CCBezierTo (2, bezier2);

            // sprite 3
            m_kathia.Position = new CCPoint(400, 160);
            var bezierTo2 = new CCBezierTo (2, bezier2);

            m_grossini.RunAction(rep);
            m_tamara.RunAction(bezierTo1);
            m_kathia.RunAction(bezierTo2);
        }