public void StartWaveAnimation() { if (!started) { started = true; animator = new TimeAnimator(); animator.Time += HandleTime; animator.Start(); } }
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); }
public void StopWaveAnimation() { for (int i = 0; i < Count; i++) { v [i] = 0; } started = false; if (animator != null) { animator.Cancel(); animator = null; } }
void HandleTime(object sender, TimeAnimator.TimeEventArgs e) { elapsed += e.DeltaTime; if (elapsed > AnimationStep) { elapsed = elapsed % AnimationStep; Step (); } }
public void StopWaveAnimation() { for (int i = 0; i < Count; i++) v [i] = 0; started = false; if (animator != null) { animator.Cancel (); animator = null; } }
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(); }