stop piece screen overflow
This commit is contained in:
parent
3d4730cfc0
commit
b4ece0812e
@ -28,17 +28,17 @@ public class GameUI extends Group{
|
|||||||
for (Piece p : level.getPieces()) {
|
for (Piece p : level.getPieces()) {
|
||||||
MatrixShape _piece = new MatrixShape(p);
|
MatrixShape _piece = new MatrixShape(p);
|
||||||
|
|
||||||
_piece.setLayoutX(piece_space.x);
|
if(piece_space.y + _piece.boundary_size.y >= Controller.screen_size.y){
|
||||||
_piece.setLayoutY(piece_space.y);
|
|
||||||
|
|
||||||
piece_space.y += _piece.boundary_size.y;
|
|
||||||
|
|
||||||
if(piece_space.y >= Controller.screen_size.y){
|
|
||||||
column++;
|
column++;
|
||||||
piece_space.y = SPACE_SIZE;
|
piece_space.y = SPACE_SIZE;
|
||||||
piece_space.x = (SEGMENT_SIZE*3 + SPACE_SIZE*4 )* column;
|
piece_space.x = (SEGMENT_SIZE*3 + SPACE_SIZE*4 )* column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_piece.setLayoutX(piece_space.x);
|
||||||
|
_piece.setLayoutY(piece_space.y);
|
||||||
|
|
||||||
|
piece_space.y += _piece.boundary_size.y;
|
||||||
|
|
||||||
// Pieces Events
|
// Pieces Events
|
||||||
_piece.setOnMouseClicked(event -> {
|
_piece.setOnMouseClicked(event -> {
|
||||||
if(event.getButton() == MouseButton.SECONDARY){
|
if(event.getButton() == MouseButton.SECONDARY){
|
||||||
|
Loading…
Reference in New Issue
Block a user