mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Added toggle for fps #story[463]
This commit is contained in:
@@ -45,7 +45,7 @@ public class CanvasController {
|
||||
@FXML
|
||||
private BoatPositionController teamPositionsController;
|
||||
@FXML
|
||||
private CheckBox toggleAnnotation;
|
||||
private CheckBox toggleAnnotation, toggleFps;
|
||||
|
||||
private Race race;
|
||||
private GraphicsContext gc;
|
||||
@@ -61,6 +61,7 @@ public class CanvasController {
|
||||
private final int SCALE = 16000;
|
||||
|
||||
private boolean annotationCheck = true;
|
||||
private boolean displayFps = true;
|
||||
|
||||
///test
|
||||
private HashSet<Integer> headingTest = new HashSet<>();
|
||||
@@ -149,6 +150,12 @@ public class CanvasController {
|
||||
annotationCheck = !annotationCheck;
|
||||
}
|
||||
});
|
||||
toggleFps.selectedProperty().addListener(new ChangeListener<Boolean>() {
|
||||
@Override
|
||||
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
|
||||
displayFps = !displayFps;
|
||||
}
|
||||
});
|
||||
|
||||
//set wind direction!!!!!!! can't find another place to put my code --haoming
|
||||
double windDirection = new ConfigParser("/config.xml").getWindDirection();
|
||||
@@ -267,10 +274,12 @@ public class CanvasController {
|
||||
}
|
||||
|
||||
private void drawFps(int fps){
|
||||
gc.setFill(Color.BLACK);
|
||||
gc.setFont(new Font(14));
|
||||
gc.setLineWidth(3);
|
||||
gc.fillText(fps + " FPS", 5, 20);
|
||||
if (displayFps){
|
||||
gc.setFill(Color.BLACK);
|
||||
gc.setFont(new Font(14));
|
||||
gc.setLineWidth(3);
|
||||
gc.fillText(fps + " FPS", 5, 20);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user