More camera refactor

This commit is contained in:
2022-10-28 21:22:44 +01:00
parent 2e7cd0aec2
commit 32744d7cb3
5 changed files with 18 additions and 13 deletions
+3 -1
View File
@@ -1,5 +1,6 @@
module Dodge.Render.InfoBox where
import Control.Lens
import Dodge.Base
import Dodge.Data.Universe
import Dodge.Render.Connectors
@@ -10,11 +11,12 @@ import Picture
renderInfoListAt :: Float -> Float -> Configuration -> World -> (Point2, [String]) -> Picture
renderInfoListAt x y cfig w (p, ss) =
renderListAt x y cfig (zip ss (repeat white))
<> winScale cfig (color white $ lConnect (V2 (x - hw) (hh -25 - y)) (worldPosToScreen w p))
<> winScale cfig (color white $ lConnect (V2 (x - hw) (hh -25 - y)) (worldPosToScreen cam p))
<> listCursorNSW x y cfig 0 white 19 (length ss)
where
hw = halfWidth cfig
hh = halfHeight cfig
cam = w ^. cWorld . lWorld . camPos
renderInfoListsAt :: Float -> Float -> Configuration -> World -> [(Point2, [String])] -> Picture
renderInfoListsAt x y cfig w =