Skip to content
Snippets Groups Projects
Commit 5d909026 authored by Jerusalem Laila's avatar Jerusalem Laila
Browse files

ids for css and background implemented

parent 5b50e395
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
......@@ -5,7 +5,7 @@
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.example.OptionsScreen.OptionsScreenController">
<GridPane id="options" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.example.OptionsScreen.OptionsScreenController">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
......@@ -15,44 +15,36 @@
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Options" textAlignment="CENTER">
<Label text="Edition" GridPane.rowIndex="1">
<GridPane.margin>
<Insets left="245.0" />
<Insets left="100.0" top="70.0" />
</GridPane.margin>
<font>
<Font size="30.0" />
</font></Label>
<Label text="Edition:" GridPane.rowIndex="1">
<GridPane.margin>
<Insets bottom="70.0" left="100.0" top="70.0" />
</GridPane.margin>
<font>
<Font size="20.0" />
</font>
</Label>
<RadioButton fx:id="normalBackground" mnemonicParsing="false" text="Normal" GridPane.rowIndex="1">
<GridPane.margin>
<Insets bottom="70.0" left="235.0" top="70.0" />
<Insets left="235.0" top="70.0" />
</GridPane.margin>
<toggleGroup>
<ToggleGroup fx:id="background" />
</toggleGroup>
<font>
<Font size="16.0" />
</font>
</RadioButton>
<RadioButton fx:id="bezwingerBackground" mnemonicParsing="false" selected="true" text="Bezwinger" toggleGroup="$background" GridPane.rowIndex="1">
<RadioButton fx:id="bezwingerBackground" mnemonicParsing="false" selected="true" text="Bezwinger-Edition" toggleGroup="$background" GridPane.rowIndex="1">
<GridPane.margin>
<Insets bottom="70.0" left="370.0" top="70.0" />
<Insets left="320.0" top="70.0" />
</GridPane.margin>
<font>
<Font size="16.0" />
</font>
</RadioButton>
<Button mnemonicParsing="false" onAction="#openSnakeGame" prefHeight="50.0" prefWidth="80.0" text="Play" GridPane.rowIndex="2">
<GridPane.margin>
<Insets left="265.0" />
</GridPane.margin>
</Button>
<Label text="Options">
<padding>
<Insets left="230.0" />
</padding>
<font>
<Font name="Courier New" size="40.0" />
</font>
</Label>
</children>
</GridPane>
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="org.example.SnakeGame.SnakeGameController"
prefHeight="500.0" prefWidth="600.0"
fx:id="anchorPane">
<AnchorPane id="game" fx:id="anchorPane" prefHeight="500.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.example.SnakeGame.SnakeGameController">
</AnchorPane>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<!--
Adding stylesheets="/styles/styles.css" yet does not work, see FxmlGuiDriver as well.
-->
<GridPane fx:controller="org.example.HelloController"
hgap="5.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
prefHeight="402.0" prefWidth="600.0" styleClass="main-panel" vgap="5.0"
xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" >
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="319.0" minWidth="10.0" prefWidth="279.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="470.0" minWidth="10.0" prefWidth="321.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="First name:" />
<Label text="Last name:" GridPane.rowIndex="1" />
<Button mnemonicParsing="false" text="Say hello" GridPane.rowIndex="2" />
<TextField fx:id="firstNameField" GridPane.columnIndex="1" />
<TextField fx:id="lastNameField" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label fx:id="helloLabel" styleClass="hello-message" text=" "
GridPane.columnIndex="1" GridPane.rowIndex="2" />
</children>
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
</GridPane>
\ No newline at end of file
......@@ -3,9 +3,8 @@
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.example.StartScreen.StartScreenController">
<GridPane id="start" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.example.StartScreen.StartScreenController">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
......@@ -17,11 +16,8 @@
<children>
<Label text="PROJECT S">
<GridPane.margin>
<Insets left="250.0" right="100.0" />
<Insets left="270.0" right="100.0" />
</GridPane.margin>
<font>
<Font size="20.0" />
</font>
</Label>
<TextField id="#nameField" minWidth="-Infinity" prefHeight="50.0" prefWidth="100.0" snapToPixel="false" text="Enter your name" GridPane.rowIndex="1">
<GridPane.margin>
......
src/main/resources/styles/img.png

955 KiB

......@@ -9,8 +9,8 @@
}
.button {
-fx-text-fill: white;
-fx-font-family: "Arial Narrow";
-fx-text-fill: black;
-fx-font-family: "Kanit";
-fx-font-weight: bold;
-fx-background-color: linear-gradient(#61a2b1, #2A5058);
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0 , 1 );
......@@ -18,13 +18,11 @@
.button:hover{
-fx-background-color: #395bae;
-fx-background-color: #ffffff;
}
/* Component specific styles */
.main-panel {
-fx-background-image: url("../images/background.jpg");
#start {
-fx-background-image: url("../styles/img.png");
}
.hello-message {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment