/// <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); }
/// <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; } }
private void moveControlTo(Control card, int left, int top, Projectplace.Gui.Tweener.ease easingFunction) { moveControlTo(card, left, top, Tweener.easeOutCubic, true); }
private void moveControlTo(Control card, int left, int top, Projectplace.Gui.Tweener.ease easingFunction, bool useAnimation) { moveControlTo(card, left, top, Tweener.easeOutCubic, useAnimation, 30); }