如何使用另一个StopTransition减少StopTransition的时间?

时间:2018-04-02 18:26:50

标签: javafx

所以,我在减少完成任务所需的时间方面遇到了问题, 程序必须用一个StopTransition移动球并减少这样做所需的时间(增加移动速度)......任何帮助都会很好......

Duration time = new Duration(16.666666667);  
t1 = new PauseTransition(time);
t1.setOnFinished((e) -> {
    if (cr.getCenterX() + 10 < 320) 
        cr.setCenterX(cr.getCenterX() + 1);
    t1.playFromStart();
});
t1.play();
t2.setOnFinished(e ->{
    Duration t=t1.getDuration().subtract(new Duration(1));
    t1.stop();
    t1.setDuration(t);
    t1.play();
    t2.playFromStart();    
});
t2.play();

0 个答案:

没有答案