Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- VBox vbox = new VBox();
- vbox.setLayoutX(170);
- vbox.setLayoutY(225);
- final String content = "Start the game";
- final Text text = new Text(10, 20, "");
- text.setFont(Font.font("Cambria", FontWeight.BOLD, 40));
- final Animation animation = new Transition() {
- {
- setCycleDuration(Duration.millis(2000));
- }
- protected void interpolate(double frac) {
- final int length = content.length();
- final int n = Math.round(length * (float) frac);
- text.setText(content.substring(0, n));
- }
- };
- animation.play();
- final long startTime = System.currentTimeMillis();
- vbox.getChildren().add(text);
- vbox.setSpacing(10);
- ((Group) scene.getRoot()).getChildren().add(vbox);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement