colormysoul
0
Q:

animationtimer javafx

static int speed x ;
// prefered speed to start with = 5;

new AnimationTimer(){
  long lastTick = 0;
  @Override
  public void handle(long now){
    if(lastTick == 0 ){
      frame();
      lastTick = now ;
      return;
    }
    if(now - lastTick > 1000000000 / speed){
      frame();
      lastTick = now;
    }
    
    }
  }.start();
0

Tags

New to Communities?

Join the community