Added map image to lobby screen

- Lobby screen has map of the course
- Map resizes with window

Tags: #story[1245]
This commit is contained in:
Michael Rausch
2017-09-11 23:24:21 +12:00
parent 0d7201e235
commit 75bf92a67f
77 changed files with 20678 additions and 20608 deletions
+19 -1
View File
@@ -41,8 +41,10 @@ import java.util.*;
public class GameView extends Pane {
private double bufferSize = 50;
private double horizontalBuffer = 0;
private double panelWidth = 1280;
private double panelHeight = 960;
private double canvasWidth = 1100;
private double canvasHeight = 920;
private boolean horizontalInversion = false;
@@ -479,6 +481,9 @@ public class GameView extends Pane {
borderPoints = border;
rescaleRace(new ArrayList<>(borderPoints));
}
rescaleRace(new ArrayList<>(border));
List<Double> boundaryPoints = new ArrayList<>();
for (Limit limit : border) {
Point2D location = findScaledXY(limit.getLat(), limit.getLng());
@@ -549,7 +554,7 @@ public class GameView extends Pane {
*
* @param limitingCoordinates the set of geo points that contains the extremities of the race.
*/
private void rescaleRace(List<GeoPoint> limitingCoordinates) {
public void rescaleRace(List<GeoPoint> limitingCoordinates) {
//Check is called once to avoid unnecessarily change the course limits once the race is running
findMinMaxPoint(limitingCoordinates);
double minLonToMaxLon = scaleRaceExtremities();
@@ -707,6 +712,7 @@ public class GameView extends Pane {
referencePointX +=
((canvasWidth - (bufferSize + bufferSize)) - (minLonToMaxLon * distanceScaleFactor))
/ 2;
referencePointX += horizontalBuffer;
}
if (horizontalInversion) {
referencePointX = canvasWidth - bufferSize - (referencePointX - bufferSize);
@@ -942,4 +948,16 @@ public class GameView extends Pane {
this.fpsDisplay = null;
this.fpsDisplay = fpsDisplay;
}
public void setSize(Double width, Double height){
this.canvasWidth = width;
this.canvasHeight = height;
this.panelWidth = width;
this.panelHeight = height;
}
public void setHorizontalBuffer(Double buff){
this.horizontalBuffer = buff;
}
}