-
Notifications
You must be signed in to change notification settings - Fork 0
/
StartController.java
41 lines (37 loc) · 1.36 KB
/
StartController.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package FX.FXSudoku;
import com.jfoenix.controls.JFXButton;
import javafx.animation.TranslateTransition;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import javafx.util.Duration;
import java.net.URL;
import java.util.ResourceBundle;
public class StartController implements Initializable{
@FXML private JFXButton loginButton;
public void initialize(URL location, ResourceBundle resources) {
TranslateTransition slideIn = new TranslateTransition(Duration.seconds(1.2),loginButton);
slideIn.setFromX(-800);
slideIn.setToX(0);
slideIn.play();
}
public void clickPlay() {
SudokuBoard.getBoard(Difficulty.EASY);
Stage primaryStage = (Stage)loginButton.getScene().getWindow();
try {
FXMLLoader loader = new FXMLLoader(getClass().getResource("GameScreen.fxml"));
GameController control = new GameController(Difficulty.EASY);
loader.setController(control);
AnchorPane pane = loader.load();
Scene scene = new Scene(pane);
primaryStage.setScene(scene);
primaryStage.setResizable(false);
primaryStage.show();
} catch (Exception e) {
e.printStackTrace();
}
}
}