32 lines
897 B
Haskell
32 lines
897 B
Haskell
module Dodge.Render.Label
|
|
where
|
|
import Dodge.Base.Coordinate
|
|
import Dodge.ShortShow
|
|
import Dodge.Base.WinScale
|
|
import Picture
|
|
import Dodge.Data.Universe
|
|
import Geometry
|
|
|
|
drawLabCrossCol :: Configuration -> CamPos -> Color -> Point2 -> Picture
|
|
drawLabCrossCol cfig w col p = drawCrossCol col p
|
|
<> drawPointLabel cfig w p
|
|
|
|
drawPointLabel :: Configuration -> CamPos -> Point2 -> Picture
|
|
drawPointLabel cfig w p =
|
|
setLayer FixedCoordLayer . winScale cfig
|
|
. uncurryV translate p'
|
|
. scale 0.1 0.1
|
|
. text
|
|
$ shortPoint2 p
|
|
where
|
|
p' = worldPosToScreen w p
|
|
|
|
drawCrossCol :: Color -> Point2 -> Picture
|
|
drawCrossCol col p = setLayer DebugLayer . color col . uncurryV translate p $ crossPic 5
|
|
|
|
drawCross :: Point2 -> Picture
|
|
drawCross = drawCrossCol red
|
|
|
|
crossPic :: Float -> Picture
|
|
crossPic x = line [V2 x x, V2 (- x) (- x)] <> line [V2 (- x) x, V2 x (- x)]
|