Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Hossein-AliHosseini committed Jul 14, 2021
1 parent 498cb66 commit 2d32605
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/main/java/Controller/ScoreBoardController.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package Controller;

import Model.User;
import javafx.geometry.Pos;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
Expand Down Expand Up @@ -52,14 +53,14 @@ public void showScoreboard(VBox vBox) {

Text text = new Text(shownRank + "- " + user.getNickname() + ": " + user.getScore() + "\n");
if (user.getUsername().equals(UserController.getInstance().getLoggedInUser().getUsername()))
text.setFill(Color.BLACK);
text.setFill(Color.YELLOW);
else
text.setFill(Color.WHITE);
Font font = new Font("Book Antiqua", 24);
text.setFont(font);
vBox.getChildren().add(text);
vBox.setAlignment(Pos.TOP_CENTER);
realRank++;

}
}

Expand Down
8 changes: 6 additions & 2 deletions src/main/java/SceneController/ScoreBoardView.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@
import javafx.fxml.FXMLLoader;
import javafx.geometry.Side;
import javafx.scene.Scene;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TextArea;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class ScoreBoardView{
private static ScoreBoardView instance = null;
private static Stage stage;
public VBox scoreBoard;
public VBox vBox;
public ScrollPane scrollPane;
public AnchorPane anchorPane;

public void start(Stage stage) throws Exception {
ScoreBoardView.stage = stage;
Expand All @@ -31,7 +35,7 @@ public void start(Stage stage) throws Exception {
}

public void initialize() {
ScoreBoardController.getInstance().showScoreboard(scoreBoard);
ScoreBoardController.getInstance().showScoreboard(vBox);
}

public static ScoreBoardView getInstance() {
Expand Down
Binary file added src/main/resources/Assets/set card .mp3
Binary file not shown.
12 changes: 11 additions & 1 deletion src/main/resources/FXML/ScoreBoardScene.fxml
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>

<Pane prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="SceneController.ScoreBoardView">
<VBox fx:id="scoreBoard" alignment="TOP_CENTER" layoutX="215.0" layoutY="60.0" prefHeight="480.0" prefWidth="470.0" />
<Button layoutX="814.0" layoutY="561.0" mnemonicParsing="false" onMouseClicked="#backToMainView" prefHeight="29.0" prefWidth="68.0" style="-fx-background-color: #f85353;" text="Back" textAlignment="CENTER">
<font>
<Font name="System Bold Italic" size="12.0" />
</font>
</Button>
<ScrollPane fx:id="scrollPane" layoutX="275.0" layoutY="60.0" prefHeight="480.0" prefWidth="350.0">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="480.0" prefWidth="350.0" style="-fx-background-color: #3faba4;">
<children>
<VBox fx:id="vBox" prefHeight="480.0" prefWidth="350.0" />
</children>
</AnchorPane>
</content>
</ScrollPane>
</Pane>

0 comments on commit 2d32605

Please sign in to comment.