Work out screen coordinates for connecting infobox

This commit is contained in:
2022-04-10 11:32:05 +01:00
parent 77c3f83d20
commit 0cc12f31ad
9 changed files with 41 additions and 43 deletions
+5 -2
View File
@@ -4,7 +4,7 @@ import Dodge.Data
--import Dodge.Base.WinScale
import Dodge.Render.Connectors
import Dodge.Render.List
import Dodge.Base.Coordinate
import Dodge.Base
import Picture
import Geometry
--import Control.Monad
@@ -12,4 +12,7 @@ import Geometry
renderInfoListAt :: Float -> Float -> Configuration -> World -> (Point2,[String]) -> Picture
renderInfoListAt x y cfig w (p,ss) = renderListAt x y cfig (zip ss (repeat white))
<> zConnect (V2 x y) (worldPosToScreenNorm cfig w p)
<> winScale cfig (color yellow $ zConnect (V2 (20+x-hw) (y+hh-20)) (worldPosToScreen w p))
where
hw = halfWidth cfig
hh = halfHeight cfig