From 49d2c5d7ab920cc5aa2f5dff4a1fab9bfedc4a5d Mon Sep 17 00:00:00 2001 From: Eddy Date: Thu, 23 Mar 2023 14:54:45 +0100 Subject: [PATCH] WIP:piece graphics --- Piece/src/application/Piece.java | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Piece/src/application/Piece.java diff --git a/Piece/src/application/Piece.java b/Piece/src/application/Piece.java new file mode 100644 index 0000000..19e24b7 --- /dev/null +++ b/Piece/src/application/Piece.java @@ -0,0 +1,35 @@ +package application; +import javafx.application.Application; +import javafx.scene.Group; +import javafx.scene.Scene; +import javafx.scene.paint.Color; +import javafx.scene.shape.Polygon; +import javafx.stage.Stage; +public class Piece extends Application{ + + public void start(Stage primaryStage) throws Exception { + + Polygon piece1 = new Polygon(); + piece1.getPoints().addAll(new Double [] { + 0.0,0.0, + 200.0,0.0, + 200.0,200.0, + 100.0,200.0, + 100.0,100.0, + 0.0,100.0}); + + piece1.setFill(Color.LIMEGREEN); + piece1.setStroke(Color.BLACK); + + Group root = new Group(); + root.getChildren().addAll(piece1); + Scene scene = new Scene(root,490,450,Color.WHEAT); + primaryStage.setScene(scene); + primaryStage.setTitle("piece 1"); + primaryStage.show(); + } + + public static void main(String[] args) { + launch(args); + } +} \ No newline at end of file