Blocks :
|
|
Duplicate :
|
|
Duplicate :
|
|
Relates :
|
|
Relates :
|
When a Label is in a ScaleTransition the text jumps around and also seems to lose its antialising (or at least doesn't look overly smooth). public class TextAnimateApp extends Application { public static void main(String[] args) throws Exception { launch(args); } public void start(Stage stage) throws Exception { final StackPane rootPane = new StackPane(); Label label = new Label("This is a label"); label.setStyle("-fx-font-scale: 30"); ScaleTransition scale = new ScaleTransition(Duration.seconds(5), label); scale.setCycleCount(Animation.INDEFINITE); scale.setAutoReverse(true); scale.setFromX(0); scale.setFromY(0); scale.setToX(5); scale.setToY(5); scale.play(); rootPane.getChildren().add(label); Scene scene = new Scene(rootPane, 1200, 800); stage.setScene(scene); stage.show(); } }
|