1. Richard Bair
  2. fx-games


zonski  committed 36f75c9

Changed animated text nodes to use Text instead of Label - gives better visual experience.

  • Participants
  • Parent commits 4a0ca14
  • Branches default

Comments (0)

Files changed (2)

File defender/src/main/java/com/fxexperience/games/defender/ui/WelcomePanel.java

View file
  • Ignore whitespace
 import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
 import javafx.fxml.FXML;
-import javafx.scene.control.Label;
 import javafx.scene.input.MouseEvent;
 import javafx.scene.layout.VBox;
+import javafx.scene.text.Text;
 import javafx.util.Duration;
 public class WelcomePanel extends VBox {
     private final Game game;
-    @FXML private Label titleLabel;
-    @FXML private Label captionLabel;
+    @FXML private Text titleLabel;
+    @FXML private Text captionLabel;
     @FXML private VBox topHalf;
     @FXML private VBox bottomHalf;
-    @FXML private Label producedByLabel;
+    @FXML private Text producedByLabel;
     private SequentialTransition transition;

File defender/src/main/resources/fxml/WelcomePanel.fxml

View file
  • Ignore whitespace
 <?import java.lang.*?>
 <?import java.util.*?>
+<?import javafx.scene.text.*?>
 <?import javafx.scene.control.*?>
 <?import javafx.scene.layout.*?>
 <?import javafx.scene.paint.*?>
     <VBox fx:id="topHalf" styleClass="top-half" VBox.vgrow="ALWAYS" fillWidth="true" alignment="CENTER">
-        <Label fx:id="titleLabel" styleClass="title" alignment="CENTER" text="JavaFX Defender"/>
-        <Label fx:id="captionLabel" alignment="CENTER" text="Shoot stuff and what not"/>
+        <Text fx:id="titleLabel" styleClass="title" text="JavaFX Defender"/>
+        <Text fx:id="captionLabel" text="Shoot stuff and what not"/>
     <VBox fx:id="bottomHalf" styleClass="bottom-half" VBox.vgrow="ALWAYS" fillWidth="true" alignment="TOP_CENTER">
-        <Label fx:id="producedByLabel" alignment="CENTER" text="Brought to you by FX Experience"/>
+        <Text fx:id="producedByLabel" text="Brought to you by FX Experience"/>