Beispiel #1
0
  public void animateTo(float target, long duration) {
    this.start = value;
    this.end = target;
    this.startTime = Time.milliTime();
    this.duration = duration;

    animating = true;
  }
Beispiel #2
0
 public void update() {
   if (animating) {
     float t = (float) (Time.milliTime() - startTime) / (float) duration;
     if (t >= 1F) {
       animating = false;
       t = 1F;
     }
     this.value = (end - start) * t + start;
   }
 }