Implemented Display a Boat as a circle.
- created displayBoat function which will display a circle at a Coordinate. #story[9] #pair[cbt24, fwy13]
This commit is contained in:
@@ -2,7 +2,11 @@ package seng302.Controllers;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.canvas.Canvas;
|
||||
import javafx.scene.canvas.GraphicsContext;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.paint.Paint;
|
||||
import seng302.Coordinate;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
@@ -15,10 +19,19 @@ public class RaceController extends Controller{
|
||||
Canvas raceMap;
|
||||
@FXML
|
||||
TableView boatInfoTable;
|
||||
private GraphicsContext gc;
|
||||
|
||||
|
||||
public void displayBoat(Coordinate coordinate, Paint paint){
|
||||
gc.setFill(paint);
|
||||
gc.fillOval(coordinate.getX(), coordinate.getY(), 15, 15);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initialize(URL location, ResourceBundle resources) {
|
||||
|
||||
this.gc = raceMap.getGraphicsContext2D();
|
||||
Coordinate boat1coord = new Coordinate(60, 60);
|
||||
displayBoat(boat1coord, Color.AQUAMARINE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user