當前位置: 首頁>>代碼示例>>Java>>正文


Java Animation.setCycleCount方法代碼示例

本文整理匯總了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;
}
 
開發者ID:LtubSalad,項目名稱:voogasalad-ltub,代碼行數:20,代碼來源:AnimationImage.java

示例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();
}
 
開發者ID:ErikHumphrey,項目名稱:ics4u,代碼行數:20,代碼來源:Game.java

示例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();
}
 
開發者ID:SaiPradeepDandem,項目名稱:javafx-demos,代碼行數:20,代碼來源:JavaFX_SpriteAnimation.java

示例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();
   }
 
開發者ID:MrLoNee,項目名稱:RadialFx,代碼行數:24,代碼來源:Futurist.java

示例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;
	}
 
開發者ID:LtubSalad,項目名稱:voogasalad-ltub,代碼行數:16,代碼來源:SpriteAnimation.java

示例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();
  }
 
開發者ID:SaiPradeepDandem,項目名稱:javafx-demos,代碼行數:51,代碼來源:JavaFX_BoardAnimation.java


注:本文中的javafx.animation.Animation.setCycleCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。