public static CCMotionStreak Create(float fade, float minSeg, float stroke, CCColor3B color, string path)
        {
            var pRet = new CCMotionStreak();

            pRet.InitWithFade(fade, minSeg, stroke, color, path);
            return(pRet);
        }
Example #2
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.TouchEnabled = true;

            CCSize s = CCDirector.SharedDirector.WinSize;

            // create the streak object and add it to the scene
            streak = new CCMotionStreak(3, 3, 64, CCTypes.CCWhite, s_streak);
            AddChild(streak);

            streak.Position = (new CCPoint(s.Width / 2, s.Height / 2));
        }
Example #3
0
        public override void OnEnter()
        {
            base.OnEnter();

            // ask director the the window size
            CCSize size = CCDirector.SharedDirector.WinSize;

            streak = new CCMotionStreak(2.0f, 1.0f, 50.0f, new CCColor3B(255, 255, 0), "Images/Icon");
            AddChild(streak);

            m_center = new CCPoint(size.Width / 2, size.Height / 2);
            m_fRadius = size.Width / 3f;
            m_fAngle = 0.0f;

            Schedule(onUpdate, 0);
        }
Example #4
0
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = CCDirector.SharedDirector.WinSize;

            // the root object just rotates around
            m_root = new CCSprite(s_pPathR1);
            AddChild(m_root, 1);
            m_root.Position = new CCPoint(s.Width / 2, s.Height / 2);

            // the target object is offset from root, and the streak is moved to follow it
            m_target = new CCSprite(s_pPathR1);
            m_root.AddChild(m_target);
            m_target.Position = new CCPoint(s.Width / 4, 0);

            // create the streak object and add it to the scene
            streak = new CCMotionStreak(2, 3, 32, CCTypes.CCGreen, s_streak);
            streak.FastMode = true;
            AddChild(streak);
            // schedule an update on each frame so we can syncronize the streak with the target
            Schedule(onUpdate);

            var a1 = new CCRotateBy (2, 360);

            var action1 = new CCRepeatForever (a1);
            var motion = new CCMoveBy (2, new CCPoint(100, 0));
            m_root.RunAction(new CCRepeatForever ((CCActionInterval)new CCSequence(motion, motion.Reverse())));
            m_root.RunAction(action1);

            var colorAction = new CCRepeatForever ((CCActionInterval)
                new CCSequence(
                    new CCTintTo (0.2f, 255, 0, 0),
                    new CCTintTo (0.2f, 0, 255, 0),
                    new CCTintTo (0.2f, 0, 0, 255),
                    new CCTintTo (0.2f, 0, 255, 255),
                    new CCTintTo (0.2f, 255, 255, 0),
                    new CCTintTo (0.2f, 255, 0, 255),
                    new CCTintTo (0.2f, 255, 255, 255)
                    )
                );

            streak.RunAction(colorAction);
        }
 public static CCMotionStreak Create(float fade, float minSeg, float stroke, CCColor3B color, string path)
 {
     var pRet = new CCMotionStreak();
     pRet.InitWithFade(fade, minSeg, stroke, color, path);
     return pRet;
 }
 public static CCMotionStreak Create(float fade, float minSeg, float stroke, CCColor3B color, CCTexture2D texture)
 {
     var pRet = new CCMotionStreak();
     pRet.InitWithFade(fade, minSeg, stroke, color, texture);
     return pRet;
 }