Adding Gap and texture
This commit is contained in:
@ -1,24 +1,28 @@
|
||||
package school_project;
|
||||
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.layout.BorderPane;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.paint.Color;
|
||||
import school_project.Utils.MatrixShape;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
public class GameUI extends BorderPane {
|
||||
public final static int SEGMENT_SIZE = 50;
|
||||
public GameUI(Map level) {
|
||||
public final static int SPACE_SIZE = 5;
|
||||
public GameUI(Map level) throws FileNotFoundException {
|
||||
super();
|
||||
|
||||
MatrixShape grid = new MatrixShape(level);
|
||||
MatrixShape grid = new MatrixShape(level, true);
|
||||
grid.setAlignment(Pos.CENTER);
|
||||
grid.setColor(Color.WHITE);
|
||||
|
||||
HBox pieces = new HBox();
|
||||
pieces.setSpacing(10);
|
||||
for (Piece p : level.getPieces()) {
|
||||
MatrixShape _piece = new MatrixShape(p);
|
||||
MatrixShape _piece = new MatrixShape(p, false);
|
||||
_piece.setColor(p.getColor());
|
||||
pieces.getChildren().add(_piece);
|
||||
}
|
||||
|
Reference in New Issue
Block a user