Skip to content
Snippets Groups Projects
Commit 7ad751ec authored by Kjetil Karstensen Indrehus's avatar Kjetil Karstensen Indrehus
Browse files

add: made the scene able resize

parent 3636ac62
Branches
No related tags found
No related merge requests found
......@@ -4,4 +4,6 @@ module no.ntnu.cardgame {
opens no.ntnu.cardgame to javafx.fxml;
exports no.ntnu.cardgame;
exports no.ntnu.cardgame.FrontEnd.controllers;
opens no.ntnu.cardgame.FrontEnd.controllers to javafx.fxml;
}
package no.ntnu.cardgame;
package no.ntnu.cardgame.FrontEnd.controllers;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
......
......@@ -17,9 +17,8 @@ public class Main extends Application {
Scene scene = new Scene(loader.load());
stage.setTitle("Card Application");
stage.setScene(scene);
//stage.setResizable(false);
stage.initStyle(StageStyle.UTILITY);
stage.setMinWidth(1200);
stage.setMinHeight(800);
stage.show();
}
}
......@@ -42,6 +42,7 @@
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.ProgressIndicator?>
<?import javafx.scene.control.SeparatorMenuItem?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.TextField?>
......@@ -52,48 +53,48 @@
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<BorderPane minHeight="500.0" minWidth="500.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.cardgame.Controller">
<BorderPane minHeight="500.0" minWidth="1000.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.cardgame.FrontEnd.controllers.Controller">
<center>
<TabPane tabClosingPolicy="UNAVAILABLE">
<TabPane minHeight="500.0" minWidth="500.0" tabClosingPolicy="UNAVAILABLE" tabMinWidth="50.0">
<tabs>
<Tab text="CARDS">
<content>
<BorderPane>
<center>
<AnchorPane maxHeight="727.0" maxWidth="1055.0" minHeight="651.0" minWidth="1055.0" prefHeight="651.0" prefWidth="1055.0">
<AnchorPane maxHeight="727.0" maxWidth="1055.0" minHeight="500.0" minWidth="500.0" prefHeight="651.0" prefWidth="1055.0">
<children>
<Button fx:id="buttonDealHand" layoutX="810.0" layoutY="448.0" mnemonicParsing="false" onAction="#onDealHand" prefHeight="25.0" prefWidth="101.0" text="Deal Hand" AnchorPane.bottomAnchor="178.66666666666669" AnchorPane.rightAnchor="143.9999999999999" />
<Button fx:id="buttonDealHand" alignment="CENTER" layoutX="705.0" layoutY="479.0" mnemonicParsing="false" onAction="#onDealHand" prefHeight="25.0" prefWidth="101.0" text="Deal Hand" />
<ImageView fitHeight="150.0" fitWidth="309.0" layoutX="388.0" layoutY="31.0" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="546.0" AnchorPane.leftAnchor="388.0" AnchorPane.rightAnchor="441.8592834472656" AnchorPane.topAnchor="31.0">
<image>
<Image url="@img/fixedImg/card-set.jpg" />
</image>
</ImageView>
<ImageView fx:id="cardone" fitHeight="150.0" fitWidth="156.0" layoutX="190.0" layoutY="222.0" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="355.0" AnchorPane.rightAnchor="757.8571395874023" AnchorPane.topAnchor="222.0">
<ImageView fx:id="cardone" fitHeight="150.0" fitWidth="156.0" layoutX="190.0" layoutY="222.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/fixedImg/backside.png" />
</image>
</ImageView>
<ImageView fx:id="cardthree" fitHeight="150.0" fitWidth="156.0" layoutX="448.0" layoutY="222.0" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="355.0" AnchorPane.rightAnchor="499.85713958740234" AnchorPane.topAnchor="222.0">
<ImageView fx:id="cardthree" fitHeight="150.0" fitWidth="156.0" layoutX="448.0" layoutY="222.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/fixedImg/backside.png" />
</image>
</ImageView>
<ImageView fx:id="cardtwo" fitHeight="150.0" fitWidth="156.0" layoutX="318.0" layoutY="222.0" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="355.0" AnchorPane.rightAnchor="629.8571395874023" AnchorPane.topAnchor="222.0">
<ImageView fx:id="cardtwo" fitHeight="150.0" fitWidth="156.0" layoutX="318.0" layoutY="222.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/fixedImg/backside.png" />
</image>
</ImageView>
<ImageView fx:id="cardfour" fitHeight="150.0" fitWidth="156.0" layoutX="585.0" layoutY="222.0" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="355.0" AnchorPane.rightAnchor="362.85713958740234" AnchorPane.topAnchor="222.0">
<ImageView fx:id="cardfour" fitHeight="150.0" fitWidth="156.0" layoutX="585.0" layoutY="222.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/fixedImg/backside.png" />
</image>
</ImageView>
<ImageView fx:id="cardfive" fitHeight="150.0" fitWidth="156.0" layoutX="710.0" layoutY="222.0" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="355.0" AnchorPane.rightAnchor="237.85713958740234" AnchorPane.topAnchor="222.0">
<ImageView fx:id="cardfive" fitHeight="150.0" fitWidth="156.0" layoutX="710.0" layoutY="222.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/fixedImg/backside.png" />
</image>
</ImageView>
<Button fx:id="buttonCheckHand" layoutX="810.0" layoutY="505.0" mnemonicParsing="false" onAction="#onCheckHand" prefHeight="25.0" prefWidth="93.0" text="Check Hand" />
<Button fx:id="buttonCheckHand" alignment="CENTER" contentDisplay="BOTTOM" layoutX="709.0" layoutY="530.0" mnemonicParsing="false" onAction="#onCheckHand" prefHeight="25.0" prefWidth="93.0" text="Check Hand" />
<Text layoutX="53.0" layoutY="476.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Current hand:" wrappingWidth="80.0" />
<Text layoutX="53.0" layoutY="572.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Has flush:" wrappingWidth="80.0" />
<Text layoutX="37.0" layoutY="522.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Amount of hearts: " wrappingWidth="137.5078125" />
......@@ -153,6 +154,13 @@
<MenuItem mnemonicParsing="false" onAction="#onNewDeck" text="New deck..." />
</items>
</Menu>
<Menu mnemonicParsing="false" text="About">
<items>
<MenuItem mnemonicParsing="false" text="Version" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="About" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Exit">
<items>
<MenuItem mnemonicParsing="false" onAction="#onExit" text="Exit application..." />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment