52 lines
1.3 KiB
Haskell
52 lines
1.3 KiB
Haskell
module Dodge.Render.Picture (
|
|
fixedCoordPictures,
|
|
) where
|
|
|
|
import Control.Lens
|
|
import Dodge.Base.WinScale
|
|
import Dodge.Base.Window
|
|
import Dodge.Data.Universe
|
|
import Dodge.Render.HUD
|
|
import Dodge.Render.List
|
|
import Dodge.Render.MenuScreen
|
|
import Geometry
|
|
import Picture
|
|
|
|
fixedCoordPictures :: Universe -> Picture
|
|
fixedCoordPictures u =
|
|
drawConcurrentMessage u <> case u ^. uvScreenLayers of
|
|
[] ->
|
|
pictures
|
|
[ hudDrawings u
|
|
, customMouseCursor cfig w
|
|
]
|
|
(lay : _) -> setDepth (-1) . winScale cfig $ menuScreen u lay
|
|
where
|
|
w = _uvWorld u
|
|
cfig = _uvConfig u
|
|
|
|
drawConcurrentMessage :: Universe -> Picture
|
|
drawConcurrentMessage u = case u ^. uvConcEffects of
|
|
BlockingConcEffect str -> fillWidthText cfig str
|
|
--listPicturesAt
|
|
--(halfWidth cfig)
|
|
--(halfHeight cfig)
|
|
--cfig
|
|
--[centerText str]
|
|
BackgroundConcEffect str ->
|
|
listPicturesAt
|
|
(halfWidth cfig)
|
|
(_windowY cfig - 50)
|
|
cfig
|
|
[centerText str]
|
|
_ -> mempty
|
|
where
|
|
cfig = _uvConfig u
|
|
|
|
customMouseCursor :: Configuration -> World -> Picture
|
|
customMouseCursor cfig w =
|
|
winScale cfig
|
|
. uncurryV translate (_mousePos w)
|
|
. color white
|
|
$ pictures [line [V2 (-5) 0, V2 5 0], line [V2 0 (-5), V2 0 5]]
|