mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Merge remote-tracking branch 'origin/NewUI_merge' into NewUI_merge
This commit is contained in:
@@ -1,17 +1,12 @@
|
||||
package seng302.visualiser.controllers.cells;
|
||||
|
||||
import javafx.animation.AnimationTimer;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.geometry.Point3D;
|
||||
import javafx.scene.Group;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.transform.Rotate;
|
||||
import javafx.scene.transform.Scale;
|
||||
import javafx.scene.transform.Translate;
|
||||
import seng302.utilities.Sounds;
|
||||
import seng302.visualiser.fxObjects.assets_3D.BoatMeshType;
|
||||
import seng302.visualiser.fxObjects.assets_3D.BoatModel;
|
||||
@@ -29,7 +24,6 @@ public class PlayerCell {
|
||||
//---------FXML END---------//
|
||||
|
||||
private String name;
|
||||
private Integer boatAngle;
|
||||
private Color boatColor;
|
||||
private Integer playerId;
|
||||
|
||||
@@ -37,34 +31,13 @@ public class PlayerCell {
|
||||
this.playerId = playerId;
|
||||
this.name = playerName;
|
||||
this.boatColor = color;
|
||||
this.boatAngle = -45;
|
||||
}
|
||||
|
||||
public void initialize() {
|
||||
playerName.setText(name);
|
||||
|
||||
Group group = new Group();
|
||||
boatPane.getChildren().add(group);
|
||||
|
||||
BoatModel bo = ModelFactory.boatIconView(BoatMeshType.DINGHY, this.boatColor);
|
||||
bo.showSail();
|
||||
bo.rotateSail(45);
|
||||
bo.getAssets().getTransforms().setAll(
|
||||
new Scale(4, 4, 4),
|
||||
new Translate(12, 14, 0),
|
||||
new Rotate(270, new Point3D(1, 0, 0)),
|
||||
new Rotate(-45, new Point3D(0, 0, 1))
|
||||
);
|
||||
|
||||
bo.setAnimation(new AnimationTimer() {
|
||||
Group group = bo.getAssets();
|
||||
|
||||
@Override
|
||||
public void handle(long now) {
|
||||
((Rotate) group.getTransforms().get(3)).setAngle(boatAngle++);
|
||||
}
|
||||
});
|
||||
|
||||
group.getChildren().add(bo.getAssets());
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user