Example #1
0
 public void StartWaveAnimation()
 {
     if (!started)
     {
         started        = true;
         animator       = new TimeAnimator();
         animator.Time += HandleTime;
         animator.Start();
     }
 }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            TimeAnimator animator = new TimeAnimator();

            label1.BackColor = Color.Blue;
            var size     = new SizeHandler(new Size(10, 400), new Size(300, 250), x => label1.Size = x);
            var color    = new ColorHandler(Color.Brown, Color.Blue, x => label1.BackColor = x);
            var location = new PositionHandler(new Point(0, 200), new Point(1200, 200), x => label1.Location = x);

            animator.Animate(1000, 100, new AnimateHandlerGroup(new IAnimateHandler[] { color, location, size }), null, AnimateFunctionType.CubicEaseInOut);
        }
Example #3
0
 public void StopWaveAnimation()
 {
     for (int i = 0; i < Count; i++)
     {
         v [i] = 0;
     }
     started = false;
     if (animator != null)
     {
         animator.Cancel();
         animator = null;
     }
 }
Example #4
0
 void HandleTime(object sender, TimeAnimator.TimeEventArgs e)
 {
     elapsed += e.DeltaTime;
     if (elapsed > AnimationStep) {
         elapsed = elapsed % AnimationStep;
         Step ();
     }
 }
Example #5
0
 public void StopWaveAnimation()
 {
     for (int i = 0; i < Count; i++)
         v [i] = 0;
     started = false;
     if (animator != null) {
         animator.Cancel ();
         animator = null;
     }
 }
Example #6
0
 public void StartWaveAnimation()
 {
     if (!started) {
         started = true;
         animator = new TimeAnimator ();
         animator.Time += HandleTime;
         animator.Start ();
     }
 }
 public void OnTimeUpdate(TimeAnimator animation, long totalTime, long deltaTime)
 {
     throw new NotImplementedException();
 }