Exemplo n.º 1
0
        //Parallel Group By List
        public static XTween ParallelTweensWithList(List <XTween> list)
        {
            XTween t = new XTween(list.ToArray());

            t.groupType_ = GroupType.Parallel;
            return(t);
        }
Exemplo n.º 2
0
        //Serial Group
        public static XTween SerialTweens(params XTween[] args)
        {
            XTween t = new XTween(args);

            t.groupType_ = GroupType.Serial;
            return(t);
        }
Exemplo n.º 3
0
        //Parallel Group
        public static XTween ParallelTweens(params XTween[] args)
        {
            XTween t = new XTween(args);

            t.groupType_ = GroupType.Parallel;
            return(t);
        }
Exemplo n.º 4
0
 //clear current time
 private void ResetAllChildTime(XTween tween)
 {
     if (tween.children_ != null && tween.children_.Length > 0)
     {
         foreach (XTween child in tween.children_)
         {
             ResetAllChildTime(child);
         }
     }
     tween.isSetCurrentFrom_ = false;
     tween.isComplete_       = false;
     tween.currentTime_      = 0;
 }
Exemplo n.º 5
0
        private void PlayAnimation1(object sender, TappedRoutedEventArgs e)
        {
            Button bt = (Button)sender;
            bt.IsEnabled = false;
            double originWidth = Target1.Width;

            var tween = new XTween(Target1, "Width", originWidth, cellWidth_ - 20, 2, XTween.Easing.EaseExpoInOut);
            tween.OnCompleted += (sender_, e_) => {
                Target1.Width = originWidth;
                bt.IsEnabled = true;
            };
            tween.Play();
        }
Exemplo n.º 6
0
        //All Tween finish flag
        private bool IsAllChildFinish(XTween tween)
        {
            bool isAllFinish = true;

            if (tween.children_ != null && tween.children_.Length > 0)
            {
                foreach (XTween child in tween.children_)
                {
                    if (!IsAllChildFinish(child))
                    {
                        isAllFinish = false;
                        break;
                    }
                }
            }
            else
            {
                isAllFinish = tween.IsFinish();
            }
            return(isAllFinish);
        }
Exemplo n.º 7
0
 //Recursive processing
 private void TweenAllPlay(XTween tween, double delta)
 {
     if (tween.children_ != null && tween.children_.Length > 0)
     {
         if (tween.IsFinish())
         {
             for (int i = 0; i < tween.children_.Length; ++i)
             {
                 XTween child = tween.children_[i];
                 TweenAllPlay(child, delta);
                 if (!IsAllChildFinish(child) && tween.groupType_ == GroupType.Serial)
                 {
                     break;
                 }
             }
         }
         else
         {
             tween.AddTime(delta);
         }
     }
     else
     {
         if (!tween.IsFinish())
         {
             tween.AddTime(delta);
         }
     }
     //Check Complete
     if (!tween.isComplete_ && IsAllChildFinish(tween))
     {
         tween.isComplete_ = true;
         tween.Stop();
         EventHandler handler = tween.onCompleted_;
         if (handler != null)
         {
             handler(this, EventArgs.Empty);
         }
     }
 }
Exemplo n.º 8
0
 //Recursive processing
 private void TweenAllPlay(XTween tween, double delta)
 {
     if (tween.children_ != null && tween.children_.Length > 0)
     {
         if (tween.IsFinish())
         {
             for (int i = 0; i < tween.children_.Length; ++i)
             {
                 XTween child = tween.children_[i];
                 TweenAllPlay(child, delta);
                 if (!IsAllChildFinish(child) && tween.groupType_ == GroupType.Serial)
                 {
                     break;
                 }
             }
         }
         else
         {
             tween.AddTime(delta);
         }
     }
     else
     {
         if (!tween.IsFinish())
         {
             tween.AddTime(delta);
         }
     }
     //Check Complete
     if (!tween.isComplete_ && IsAllChildFinish(tween))
     {
         tween.isComplete_ = true;
         tween.Stop();
         EventHandler handler = tween.onCompleted_;
         if (handler != null)
         {
             handler(this, EventArgs.Empty);
         }
     }
 }
Exemplo n.º 9
0
 //clear current time
 private void ResetAllChildTime(XTween tween)
 {
     if (tween.children_ != null && tween.children_.Length > 0)
     {
         foreach (XTween child in tween.children_)
         {
             ResetAllChildTime(child);
         }
     }
     tween.isSetCurrentFrom_ = false;
     tween.isComplete_ = false;
     tween.currentTime_ = 0;
 }
Exemplo n.º 10
0
 //All Tween finish flag
 private bool IsAllChildFinish(XTween tween)
 {
     bool isAllFinish = true;
     if (tween.children_ != null && tween.children_.Length > 0)
     {
         foreach(XTween child in tween.children_)
         {
             if (!IsAllChildFinish(child))
             {
                 isAllFinish = false;
                 break;
             }
         }
     }
     else
     {
         isAllFinish = tween.IsFinish();
     }
     return isAllFinish;
 }
Exemplo n.º 11
0
 //Serial Group By List
 public static XTween SerialTweensWithList(List<XTween> list)
 {
     XTween t = new XTween(list.ToArray());
     t.groupType_ = GroupType.Serial;
     return t;
 }
Exemplo n.º 12
0
 //Serial Group
 public static XTween SerialTweens(params XTween[] args)
 {
     XTween t = new XTween(args);
     t.groupType_ = GroupType.Serial;
     return t;
 }
Exemplo n.º 13
0
 //Parallel Group
 public static XTween ParallelTweens(params XTween[] args)
 {
     XTween t = new XTween(args);
     t.groupType_ = GroupType.Parallel;
     return t;
 }