Adjusted the labels for the game play, so they don't distract - now they are smaller and in a different place
This commit is contained in:
parent
7d3985530e
commit
0b465ab800
@ -1,12 +1,17 @@
|
||||
package ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.game;
|
||||
|
||||
import ch.unibas.dmi.dbis.cs108.BudaLogConfig;
|
||||
import javafx.animation.Interpolator;
|
||||
import javafx.animation.Transition;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.util.Duration;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
public class BellAnimation extends Transition {
|
||||
public static final Logger LOGGER = LogManager.getLogger(BellAnimation.class);
|
||||
public static final BudaLogConfig l = new BudaLogConfig(LOGGER);
|
||||
ImageView imageView;
|
||||
Image[] bells;
|
||||
int index;
|
||||
@ -23,9 +28,13 @@ public class BellAnimation extends Transition {
|
||||
|
||||
@Override
|
||||
protected void interpolate(double frac) {
|
||||
try {
|
||||
if (index < 17) {
|
||||
imageView.setImage(bells[index]);
|
||||
}
|
||||
index++;
|
||||
} catch (Exception e) {
|
||||
LOGGER.warn(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ import javafx.scene.Group;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.effect.DropShadow;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
@ -429,71 +430,30 @@ public class GameController implements Initializable {
|
||||
String[] roles = gameStateModel.getPassengerTrainClone()[1];
|
||||
boolean[] kickedOff = gameStateModel.getKickedOff();
|
||||
Text name0 = new Text(names[0]);
|
||||
name0.setStyle("-fx-font: 25 arial;");
|
||||
name0.setFill(Color.WHITE);
|
||||
name0.setStyle("-fx-font: 15 serif;");
|
||||
name0.setFill(Color.rgb(255,250,250,0.6));
|
||||
name0.setEffect(new DropShadow(2.5, Color.BLACK));
|
||||
Text name1 = new Text(names[1]);
|
||||
name1.setStyle("-fx-font: 25 arial;");
|
||||
name1.setFill(Color.WHITE);
|
||||
name1.setStyle("-fx-font: 15 serif;");
|
||||
name1.setFill(Color.rgb(255,250,250,0.6));
|
||||
name1.setEffect(new DropShadow(2.5, Color.BLACK));
|
||||
Text name2 = new Text(names[2]);
|
||||
name2.setStyle("-fx-font: 25 arial;");
|
||||
name2.setFill(Color.WHITE);
|
||||
name2.setStyle("-fx-font: 15 serif;");
|
||||
name2.setFill(Color.rgb(255,250,250,0.6));
|
||||
name2.setEffect(new DropShadow(2.5, Color.BLACK));
|
||||
Text name3 = new Text(names[3]);
|
||||
name3.setStyle("-fx-font: 25 arial;");
|
||||
name3.setFill(Color.WHITE);
|
||||
name3.setStyle("-fx-font: 15 serif;");
|
||||
name3.setFill(Color.rgb(255,250,250,0.6));
|
||||
name3.setEffect(new DropShadow(2.5, Color.BLACK));
|
||||
Text name4 = new Text(names[4]);
|
||||
name4.setStyle("-fx-font: 25 arial;");
|
||||
name4.setFill(Color.WHITE);
|
||||
name4.setStyle("-fx-font: 15 serif;");
|
||||
name4.setFill(Color.rgb(255,250,250,0.6));
|
||||
name4.setEffect(new DropShadow(2.5, Color.BLACK));
|
||||
Text name5 = new Text(names[5]);
|
||||
name5.setStyle("-fx-font: 25 arial;");
|
||||
name5.setFill(Color.WHITE);
|
||||
Text role0;
|
||||
if (kickedOff[0]) {
|
||||
role0 = new Text("\nkicked off");
|
||||
} else {
|
||||
role0 = new Text("\n" + roles[0]);
|
||||
}
|
||||
role0.setStyle("-fx-font: 25 arial;");
|
||||
role0.setFill(Color.WHITE);
|
||||
Text role1;
|
||||
if (kickedOff[1]) {
|
||||
role1 = new Text("\nkicked off");
|
||||
} else {
|
||||
role1 = new Text("\n" + roles[1]);
|
||||
}
|
||||
role1.setStyle("-fx-font: 25 arial;");
|
||||
role1.setFill(Color.WHITE);
|
||||
Text role2;
|
||||
if (kickedOff[2]) {
|
||||
role2 = new Text("\nkicked off");
|
||||
} else {
|
||||
role2 = new Text("\n" + roles[2]);
|
||||
}
|
||||
role2.setStyle("-fx-font: 25 arial;");
|
||||
role2.setFill(Color.WHITE);
|
||||
Text role3;
|
||||
if (kickedOff[3]) {
|
||||
role3 = new Text("\nkicked off");
|
||||
} else {
|
||||
role3 = new Text("\n" + roles[3]);
|
||||
}
|
||||
role3.setStyle("-fx-font: 25 arial;");
|
||||
role3.setFill(Color.WHITE);
|
||||
Text role4;
|
||||
if (kickedOff[4]) {
|
||||
role4 = new Text("\nkicked off");
|
||||
} else {
|
||||
role4 = new Text("\n" + roles[4]);
|
||||
}
|
||||
role4.setStyle("-fx-font: 25 arial;");
|
||||
role4.setFill(Color.WHITE);
|
||||
Text role5;
|
||||
if (kickedOff[5]) {
|
||||
role5 = new Text("\nkicked off");
|
||||
} else {
|
||||
role5 = new Text("\n" + roles[5]);
|
||||
}
|
||||
role5.setStyle("-fx-font: 25 arial;");
|
||||
role5.setFill(Color.WHITE);
|
||||
name5.setStyle("-fx-font: 15 serif;");
|
||||
name5.setFill(Color.rgb(255,250,250,0.6));
|
||||
name5.setEffect(new DropShadow(2.5, Color.BLACK));
|
||||
|
||||
|
||||
Platform.runLater(new Runnable() {
|
||||
@Override
|
||||
@ -501,22 +461,16 @@ public class GameController implements Initializable {
|
||||
try {
|
||||
lableRoom0.getChildren().clear();
|
||||
lableRoom0.getChildren().add(name0);
|
||||
lableRoom0.getChildren().add(role0);
|
||||
lableRoom1.getChildren().clear();
|
||||
lableRoom1.getChildren().add(name1);
|
||||
lableRoom1.getChildren().add(role1);
|
||||
lableRoom2.getChildren().clear();
|
||||
lableRoom2.getChildren().add(name2);
|
||||
lableRoom2.getChildren().add(role2);
|
||||
lableRoom3.getChildren().clear();
|
||||
lableRoom3.getChildren().add(name3);
|
||||
lableRoom3.getChildren().add(role3);
|
||||
lableRoom4.getChildren().clear();
|
||||
lableRoom4.getChildren().add(name4);
|
||||
lableRoom4.getChildren().add(role4);
|
||||
lableRoom5.getChildren().clear();
|
||||
lableRoom5.getChildren().add(name5);
|
||||
lableRoom5.getChildren().add(role5);
|
||||
} catch (Exception e) {
|
||||
LOGGER.trace("Not yet initialized");
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
<ImageView fx:id="noiseImage5" fitHeight="843.75" fitWidth="1500.0" layoutX="-585.0" layoutY="-125.1" preserveRatio="true" />
|
||||
<Group fx:id="roomButtonGroupDay" layoutX="288.0" layoutY="220.0">
|
||||
<children>
|
||||
<HBox fx:id="roomLables" alignment="CENTER" layoutY="82.0" prefHeight="62.0" prefWidth="747.0" rotate="12.2">
|
||||
<HBox fx:id="roomLables" alignment="CENTER" layoutX="-11.0" layoutY="170.0" prefHeight="35.0" prefWidth="717.0" rotate="12.2">
|
||||
<children>
|
||||
<TextFlow fx:id="lableRoom0" prefHeight="200.0" prefWidth="200.0" textAlignment="CENTER" />
|
||||
<TextFlow fx:id="lableRoom1" prefHeight="200.0" prefWidth="200.0" textAlignment="CENTER" />
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
}
|
||||
|
||||
#NTtBToolBar{
|
||||
-fx-border-color: grey;
|
||||
-fx-background-color: rgb(15,26,59,0.8);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user