Background of title now changes colour depending on day mode and night mode. Sun image also changes. This is so that the tutorial label is more visible during night mode. #story[1189]

main
David Wu 8 years ago
parent ea029baf22
commit 65b960f725

@ -7,7 +7,10 @@ import javafx.scene.Scene;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.control.RadioButton; import javafx.scene.control.RadioButton;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane; import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import javafx.stage.Modality; import javafx.stage.Modality;
import javafx.stage.Stage; import javafx.stage.Stage;
import mock.app.Event; import mock.app.Event;
@ -38,6 +41,10 @@ public class TitleController extends Controller {
RadioButton nightModeRD; RadioButton nightModeRD;
@FXML @FXML
Label tutorialLabel; Label tutorialLabel;
@FXML
Pane menuPane;
@FXML
ImageView imgSun;
/** /**
* Method called when the 'host a game' button is pressed. * Method called when the 'host a game' button is pressed.
@ -74,7 +81,10 @@ public class TitleController extends Controller {
*/ */
public void setDayMode(){ public void setDayMode(){
dayModeRD.getScene().getStylesheets().clear(); dayModeRD.getScene().getStylesheets().clear();
menuPane.getStylesheets().clear();
imgSun.setImage(new Image(getClass().getResource("/visualiser/images/sun.png").toExternalForm()));
dayModeRD.getScene().getStylesheets().add("/css/dayMode.css"); dayModeRD.getScene().getStylesheets().add("/css/dayMode.css");
menuPane.setStyle("-fx-background-color: #6be6ff;");
nightModeRD.setSelected(false); nightModeRD.setSelected(false);
} }
@ -83,7 +93,10 @@ public class TitleController extends Controller {
*/ */
public void setNightMode(){ public void setNightMode(){
nightModeRD.getScene().getStylesheets().clear(); nightModeRD.getScene().getStylesheets().clear();
menuPane.getStylesheets().clear();
imgSun.setImage(new Image(getClass().getResource("/visualiser/images/sunsleep.png").toExternalForm()));
nightModeRD.getScene().getStylesheets().add("/css/nightMode.css"); nightModeRD.getScene().getStylesheets().add("/css/nightMode.css");
menuPane.setStyle("-fx-background-color: #1f2c60;");
dayModeRD.setSelected(false); dayModeRD.setSelected(false);
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 KiB

@ -43,7 +43,7 @@
<Button layoutX="28.0" layoutY="152.0" mnemonicParsing="false" onAction="#controlBtnPressed" text="Controls" /> <Button layoutX="28.0" layoutY="152.0" mnemonicParsing="false" onAction="#controlBtnPressed" text="Controls" />
</children> </children>
</Pane> </Pane>
<Pane prefHeight="20.0" prefWidth="20.0" style="-fx-background-color: #6be6ff;" GridPane.columnSpan="4" GridPane.rowSpan="4"> <Pane fx:id="menuPane" prefHeight="20.0" prefWidth="20.0" style="-fx-background-color: #6be6ff;" GridPane.columnSpan="4" GridPane.rowSpan="4">
<children> <children>
<ImageView fx:id="imgBoat" fitHeight="404.0" fitWidth="296.0" layoutX="268.0" pickOnBounds="true" preserveRatio="true"> <ImageView fx:id="imgBoat" fitHeight="404.0" fitWidth="296.0" layoutX="268.0" pickOnBounds="true" preserveRatio="true">
<image> <image>

Loading…
Cancel
Save