Start implementing location display on map

This commit is contained in:
2021-03-25 17:00:08 +01:00
parent d1a4dad3c0
commit d79a8a862e
4 changed files with 34 additions and 11 deletions
+6 -6
View File
@@ -41,22 +41,22 @@ worldPictures w
fixedCoordPictures :: World -> Picture
fixedCoordPictures w = pictures
[ hudIfNoMap
[ scaler $ hudDrawings w
, scaler . onLayer MenuLayer $ menuScreen w
, setDepth (-1) $ closeObjectTexts w
]
where scaler = setDepth (-1) . scale (2 / _windowX w) (2 / _windowY w)
hudIfNoMap = case _mapDisplay w of
(True,_) -> blank
_ -> scaler $ hudDrawings w
mapOverlay :: World -> [Picture]
mapOverlay w = case _mapDisplay w of
(True,mapZoom) -> map ( setLayer 1 . setDepth (-1) . doZoom)
(True,mapZoom) -> (setLayer 1 . setDepth (-1) . color (withAlpha 0.5 black)
. polygon $ screenPolygon w)
:
(map ( setLayer 1 . setDepth (-1) . doZoom )
. mapMaybe mapWall
. IM.elems
$ _walls w
)
where
doZoom = uncurry translate (_cameraPos w)
. scale zoom zoom