This commit will align piece to their in game position #48

Merged
tonitch merged 4 commits from pieceDrawing into master 2023-05-11 20:09:46 +02:00
Showing only changes of commit 201eb3ec10 - Show all commits

View File

@ -54,6 +54,8 @@ public class GameUI extends Group{
_piece.setLayoutY(event.getSceneY() - piece_pos_click.y);
});
_piece.setOnMouseReleased(event -> {
if(event.getButton() != MouseButton.PRIMARY)
return;
if(event.getSceneX() > grid.getLayoutX() && event.getSceneX() < grid.getLayoutX() + grid.boundary_size.x
&& event.getSceneY() > grid.getLayoutY() && event.getSceneY() < grid.getLayoutY() + grid.boundary_size.y )
{