Пример #1
0
  public void animateOut(float duration, float delay) {
    alpha = t = 1;

    NumberProperty p = positionTween.getNumber("t");
    p.setEnd(0f);
    positionTween.setDuration(duration).delay(delay).play();
  }
Пример #2
0
  public void fadeOut(float duration, float delay) {
    alpha = t = 1;

    NumberProperty p = alphaTween.getNumber("alpha");
    p.setEnd(0f);
    alphaTween
        .setDuration(duration)
        .delay(delay) // .onEnd(this, "hide")
        .play();
  }
Пример #3
0
  public void fadeIn(float duration, float delay) {
    alpha = 0;
    t = 1;

    NumberProperty p = alphaTween.getNumber("alpha");
    p.setEnd(1f);
    alphaTween
        .setDuration(duration)
        .delay(delay) // .onStart(this, "show")
        .play();
  }
Пример #4
0
  @Override
  public void draw() {
    background(255);

    noStroke();

    fill(255 / 2f);
    rect(0, 0, w, height);

    fill(0);
    text(t.getRepeat(), 10, height - 10);

    String time = t.getTime() + " / " + t.getDuration();
    fill(0);
    text(time, width - textWidth(time) - 10, height - 10);
  }
Пример #5
0
 @Override
 public void keyPressed() {
   t.play();
 }