示例#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();
  }
  @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);
  }
 @Override
 public void keyPressed() {
   t.play();
 }