Loading .idea/misc.xml +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ </option> <option name="workspaceImportForciblyTurnedOn" value="true" /> </component> <component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="22" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="22" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/out" /> </component> </project> No newline at end of file src/main/java/org/example/newmat/GraphicsAndWindowsTest.java +9 −1 Original line number Diff line number Diff line Loading @@ -139,12 +139,16 @@ public class GraphicsAndWindowsTest extends Application { Label fpsLabel = new Label("FPS: 0"); fpsLabel.setTextFill(Color.WHITE); Label scoreLabel = new Label("Score: 0"); fpsLabel.setTextFill(Color.WHITE); //Lays out the children in Z order with the last member being front most //Effectively allows you to layer multiple elements //We are layering our 3D scene with a 2D label on top of it StackPane Layers = new StackPane(); Layers.getChildren().addAll(subScene3D, fpsLabel); Layers.getChildren().addAll(subScene3D, fpsLabel, scoreLabel); StackPane.setAlignment(fpsLabel, Pos.BOTTOM_RIGHT); //Places FPS in bottom right StackPane.setAlignment(scoreLabel, Pos.TOP_LEFT); //Places FPS in bottom right Scene scene = new Scene(Layers, 1500, 800); Loading @@ -157,6 +161,7 @@ public class GraphicsAndWindowsTest extends Application { private long lastUpdate = 0; //Movement timer private long fpsTimer = 0; //Frame timer private long frameRate = 0; //Frames per second private long score = 0; //Frames per second Loading Loading @@ -302,7 +307,10 @@ public class GraphicsAndWindowsTest extends Application { fpsLabel.setText(String.format("FPS: %d", frameRate)); frameRate = 0; // Reset frame count fpsTimer = now; // Reset the FPS timer score++; scoreLabel.setText(String.format("Score: %d", score)); } } }; timer.start(); Loading target/classes/org/example/newmat/GraphicsAndWindowsTest$1.class +173 B (4.73 KiB) File changed.No diff preview for this file type. View original file View changed file target/classes/org/example/newmat/GraphicsAndWindowsTest.class +132 B (6.55 KiB) File changed.No diff preview for this file type. View original file View changed file Loading
.idea/misc.xml +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ </option> <option name="workspaceImportForciblyTurnedOn" value="true" /> </component> <component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="22" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="22" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/out" /> </component> </project> No newline at end of file
src/main/java/org/example/newmat/GraphicsAndWindowsTest.java +9 −1 Original line number Diff line number Diff line Loading @@ -139,12 +139,16 @@ public class GraphicsAndWindowsTest extends Application { Label fpsLabel = new Label("FPS: 0"); fpsLabel.setTextFill(Color.WHITE); Label scoreLabel = new Label("Score: 0"); fpsLabel.setTextFill(Color.WHITE); //Lays out the children in Z order with the last member being front most //Effectively allows you to layer multiple elements //We are layering our 3D scene with a 2D label on top of it StackPane Layers = new StackPane(); Layers.getChildren().addAll(subScene3D, fpsLabel); Layers.getChildren().addAll(subScene3D, fpsLabel, scoreLabel); StackPane.setAlignment(fpsLabel, Pos.BOTTOM_RIGHT); //Places FPS in bottom right StackPane.setAlignment(scoreLabel, Pos.TOP_LEFT); //Places FPS in bottom right Scene scene = new Scene(Layers, 1500, 800); Loading @@ -157,6 +161,7 @@ public class GraphicsAndWindowsTest extends Application { private long lastUpdate = 0; //Movement timer private long fpsTimer = 0; //Frame timer private long frameRate = 0; //Frames per second private long score = 0; //Frames per second Loading Loading @@ -302,7 +307,10 @@ public class GraphicsAndWindowsTest extends Application { fpsLabel.setText(String.format("FPS: %d", frameRate)); frameRate = 0; // Reset frame count fpsTimer = now; // Reset the FPS timer score++; scoreLabel.setText(String.format("Score: %d", score)); } } }; timer.start(); Loading
target/classes/org/example/newmat/GraphicsAndWindowsTest$1.class +173 B (4.73 KiB) File changed.No diff preview for this file type. View original file View changed file
target/classes/org/example/newmat/GraphicsAndWindowsTest.class +132 B (6.55 KiB) File changed.No diff preview for this file type. View original file View changed file