本文整理匯總了Java中javafx.animation.Animation.setCycleCount方法的典型用法代碼示例。如果您正苦於以下問題:Java Animation.setCycleCount方法的具體用法?Java Animation.setCycleCount怎麽用?Java Animation.setCycleCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.animation.Animation
的用法示例。
在下文中一共展示了Animation.setCycleCount方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getImageView
import javafx.animation.Animation; //導入方法依賴的package包/類
public ImageView getImageView(int seed) {
final ImageView imageView = new ImageView();
int[] numberList = new int[6];
for(int i = 0; i < NUMBER_OF_IMAGE; i++){
numberList[i] = i;
}
shuffleArray(seed, numberList);
List<Image> list = new ArrayList<>();
for(int j =0; j < NUMBER_OF_IMAGE; j++){
list.add(getImage(numberList[j]));
}
final Animation animation = new ImageAnimation(list, imageView, Duration.millis(5000), WIDTH, HEIGHT);
animation.setCycleCount(Animation.INDEFINITE);
animation.play();
return imageView;
}
示例2: start
import javafx.animation.Animation; //導入方法依賴的package包/類
public void start(Stage primaryStage) {
primaryStage.setTitle("The Horse in Motion");
final ImageView imageView = new ImageView(IMAGE);
imageView.setViewport(new Rectangle2D(OFFSET_X, OFFSET_Y, WIDTH, HEIGHT));
final Animation animation = new SpriteAnimation(
imageView,
Duration.millis(1000),
COUNT, COLUMNS,
OFFSET_X, OFFSET_Y,
WIDTH, HEIGHT
);
animation.setCycleCount(Animation.INDEFINITE);
animation.play();
primaryStage.setScene(new Scene(new Group(imageView)));
primaryStage.show();
}
示例3: start
import javafx.animation.Animation; //導入方法依賴的package包/類
public void start(Stage primaryStage) {
primaryStage.setTitle("The Horse in Motion");
final ImageView imageView = new ImageView(IMAGE);
imageView.setViewport(new Rectangle2D(OFFSET_X, OFFSET_Y, WIDTH, HEIGHT));
final Animation animation = new SpriteAnimation(
imageView,
Duration.millis(600),
COUNT, COLUMNS,
OFFSET_X, OFFSET_Y,
WIDTH, HEIGHT
);
animation.setCycleCount(Animation.INDEFINITE);
animation.play();
primaryStage.setScene(new Scene(new Group(imageView)));
primaryStage.show();
}
示例4: animate
import javafx.animation.Animation; //導入方法依賴的package包/類
private void animate() {
final Animation frame3Transition = new Timeline(new KeyFrame(
Duration.ZERO,
new KeyValue(frame3.rotateProperty(), 0)),
new KeyFrame(Duration.millis(6700), new KeyValue(frame3.rotateProperty(), 360)));
frame3Transition.setCycleCount(Animation.INDEFINITE);
final Animation frame4Transition = new Timeline(new KeyFrame(
Duration.ZERO,
new KeyValue(frame4.rotateProperty(), 0)),
new KeyFrame(Duration.millis(12000), new KeyValue(frame4.rotateProperty(), 360)));
frame4Transition.setCycleCount(Animation.INDEFINITE);
final Animation frame5Transition = new Timeline(new KeyFrame(
Duration.ZERO,
new KeyValue(frame5.rotateProperty(), 0)),
new KeyFrame(Duration.millis(9000), new KeyValue(frame5.rotateProperty(), -360)));
frame5Transition.setCycleCount(Animation.INDEFINITE);
final ParallelTransition parallelTransition = new ParallelTransition(frame3Transition, frame4Transition, frame5Transition);
parallelTransition.play();
}
示例5: getImageView
import javafx.animation.Animation; //導入方法依賴的package包/類
public ImageView getImageView() {
final ImageView imageView = new ImageView();
List<Image> list = getSpriteImage();
final Animation animation = new ImageAnimation(
list,
imageView,
Duration.millis(1000),
WIDTH, HEIGHT
);
animation.setCycleCount(Animation.INDEFINITE);
animation.play();
return imageView;
}
示例6: start
import javafx.animation.Animation; //導入方法依賴的package包/類
public void start(Stage primaryStage) {
primaryStage.setTitle("The Board In Action");
final ImageView imageView = new ImageView(IMAGE);
imageView.setViewport(new Rectangle2D(0, 0, WIDTH, HEIGHT));
final Animation animation = new SpriteAnimation(
imageView,
Duration.millis(600),
COUNT, COLUMNS,
WIDTH, HEIGHT
);
animation.setCycleCount(3);
// animation.play();
final Animation animation2 = new SpriteAnimation(
imageView,
Duration.millis(1200),
COUNT, COLUMNS,
WIDTH, HEIGHT
);
animation2.setCycleCount(3);
//animation2.play();
final Animation animation3 = new SpriteAnimation(
imageView,
Duration.millis(1800),
COUNT, COLUMNS,
WIDTH, HEIGHT
);
animation3.setCycleCount(3);
final Animation animation4 = new SpriteAnimation(
imageView,
Duration.millis(2400),
COUNT, COLUMNS,
WIDTH, HEIGHT
);
animation4.setCycleCount(3);
final SequentialTransition sequentialTransition = SequentialTransitionBuilder.create()
.children(animation, animation2, animation3, animation4)
.cycleCount(1)
.autoReverse(true)
.build();
sequentialTransition.play();
primaryStage.setScene(new Scene(new Group(imageView)));
primaryStage.show();
}