Exemple #1
0
 private void moveControlTo(Control card, int left, int top, Projectplace.Gui.Tweener.ease easingFunction)
 {
     moveControlTo(card, left, top, Tweener.easeOutCubic, true);
 }
Exemple #2
0
 /// <summary>
 /// Animate moving a control to a new position
 /// </summary>
 /// <param name="card"></param>
 /// <param name="left"></param>
 /// <param name="top"></param>
 /// <param name="easingFunction"></param>
 /// <param name="useAnimation"></param>
 /// <param name="time"></param>
 private void moveControlTo(Control card, int left, int top, Projectplace.Gui.Tweener.ease easingFunction, bool useAnimation, int time)
 {
     // Check if the user disabled animation
     if (game.Options.UseAnimation && useAnimation)
     {
         // Perform the animation
         AnimateMotion(card, left, top, easingFunction, time);
     }
     else
     {
         // Just move the control if animation is disabled
         card.Top = top;
         card.Left = left;
     }
 }
Exemple #3
0
 private void moveControlTo(Control card, int left, int top, Projectplace.Gui.Tweener.ease easingFunction, bool useAnimation)
 {
     moveControlTo(card, left, top, Tweener.easeOutCubic, useAnimation, 30);
 }
Exemple #4
0
        /// <summary>
        /// Animate the movement of a control. Does not check if animation is enabled or not
        /// </summary>
        /// <param name="control"></param>
        /// <param name="left"></param>
        /// <param name="top"></param>
        /// <param name="easingFunction"></param>
        /// <param name="time"></param>
        private void AnimateMotion(Control control, int left, int top, Projectplace.Gui.Tweener.ease easingFunction, int time)
        {
            TweenPairs p = new TweenPairs();
            p.Add("Y", top);
            p.Add("X", left);
            Tweener t = new Tweener(control, p, easingFunction, time, 0);

            //t.setOnComplete(new Tweener.onCompleteFunction(completed));
            Tweener.add(t);
        }