Added floating test cube in title screen initialiser

#story[1191]
main
cbt24 9 years ago
parent 7086af6057
commit 1b1b0a4591

@ -1,12 +1,18 @@
package visualiser.Controllers;
import javafx.animation.AnimationTimer;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Group;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.RadioButton;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import javafx.scene.shape.Box;
import javafx.scene.shape.CullFace;
import javafx.scene.transform.Rotate;
import javafx.stage.Modality;
import javafx.stage.Stage;
import visualiser.app.App;
@ -32,6 +38,8 @@ public class TitleController extends Controller {
@FXML
RadioButton nightModeRD;
Group group3d;
/**
* Method called when the 'host a game' button is pressed.
* Opens the next window allowing a user to host their own game.
@ -81,7 +89,31 @@ public class TitleController extends Controller {
@Override
public void initialize(URL location, ResourceBundle resources) {
System.out.println("Initializing...");
Box box = new Box(50,50,50);
box.setTranslateX(100);
box.setTranslateY(100);
box.setCullFace(CullFace.BACK);
Rotate ry = new Rotate(0, 0,0,0, Rotate.Y_AXIS);
Rotate rx = new Rotate(20, 0, 0, 0, Rotate.X_AXIS);
box.getTransforms().add(ry);
box.getTransforms().add(rx);
group3d = new Group(box);
titleWrapper.getChildren().add(0, group3d);
group3d.toFront();
AnimationTimer rotation = new AnimationTimer() {
@Override
public void handle(long now) {
ry.setAngle(ry.getAngle() + 0.1);
}
};
rotation.start();
}
/**

Loading…
Cancel
Save