raycast cursor
This commit is contained in:
@@ -28,11 +28,23 @@ public class DDDView extends GameAdaptator {
|
||||
this.world = new World(new Camera());
|
||||
this.window = new Window(this.renderer, this.world);
|
||||
this.window.OnCellClick.connect(this::onCellClick);
|
||||
this.window.OnCellEnter.connect(this::onCellEnter);
|
||||
this.window.OnCellExit.connect(this::onCellExit);
|
||||
}
|
||||
|
||||
// Invoked when a cell is clicked
|
||||
private void onCellClick(Coordinate coordinate) {
|
||||
System.out.println("Cell clicked : " + coordinate);
|
||||
}
|
||||
|
||||
// Invoked when a cell is hovered
|
||||
private void onCellEnter(Coordinate coordinate) {
|
||||
System.out.println("Enter : " + coordinate);
|
||||
}
|
||||
|
||||
// Invoked when a cell is not hovered anymore
|
||||
private void onCellExit(Coordinate coordinate) {
|
||||
System.out.println("Exit : " + coordinate);
|
||||
}
|
||||
|
||||
private Piece pieceAt(Coordinate pos) {
|
||||
|
||||
Reference in New Issue
Block a user