Researched and implemented a way for the game to listen for key presses. When one of the valid key controls are pressed, feedback is given in the console. Has yet to be connected to a method which will create and send a message to the server.

#pair[kre39,zyt10] #story[988]
This commit is contained in:
Kusal Ekanayake
2017-07-11 16:32:15 +12:00
parent ba761e4951
commit ef61a687d6
5 changed files with 49 additions and 5 deletions
@@ -8,6 +8,7 @@ import javafx.scene.Group;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Polygon;
@@ -109,6 +110,7 @@ public class CanvasController {
// Bind canvas size to stack pane size.
canvas.widthProperty().bind(new SimpleDoubleProperty(CANVAS_WIDTH));
canvas.heightProperty().bind(new SimpleDoubleProperty(CANVAS_HEIGHT));
}
public void initializeCanvas (){
@@ -525,4 +527,5 @@ public class CanvasController {
List<MarkGroup> getMarkGroups() {
return markGroups;
}
}