Files
loop/src/Dodge/Render/Label.hs
T

29 lines
710 B
Haskell

module Dodge.Render.Label where
import Dodge.Data.Universe
import Dodge.ShortShow
import Geometry
import Picture
drawLabCrossCol :: Color -> Point2 -> Picture
drawLabCrossCol col p =
drawCrossCol col p
<> drawPointLabel p
drawPointLabel :: Point2 -> Picture
drawPointLabel p =
setLayer DebugLayer
. uncurryV translate p
. scale 0.1 0.1
. text
$ shortPoint2 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)]