Work out screen coordinates for connecting infobox
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -96,7 +96,7 @@ soundPic cfig w s = fixedSizePicClampArrow 50 50 thePic p cfig w
|
||||
drawPathing :: Configuration -> World -> Picture
|
||||
drawPathing cfig w
|
||||
| _debug_pathing cfig
|
||||
= -- setLayer 5 $
|
||||
= setLayer DebugLayer $
|
||||
(color green . pictures . map (thickLine 5 . tflat2) $ graphToEdges gr)
|
||||
<> concatMap dispInc (graphToIncidence gr)
|
||||
| otherwise = []
|
||||
@@ -106,7 +106,7 @@ drawPathing cfig w
|
||||
viewBoundaries :: Configuration -> World -> Picture
|
||||
viewBoundaries cfig w
|
||||
| _debug_view_boundaries cfig
|
||||
= setLayer TopLayer $ color green (concatMap (polygonWire . _grBound) grs)
|
||||
= setLayer DebugLayer $ color green (concatMap (polygonWire . _grBound) grs)
|
||||
<> color yellow (concatMap (\q -> line [p,q]) $ farWallPoints p w)
|
||||
| otherwise = []
|
||||
where
|
||||
@@ -116,9 +116,9 @@ viewBoundaries cfig w
|
||||
viewClipBounds :: Configuration -> World -> Picture
|
||||
viewClipBounds cfig w
|
||||
| _debug_view_clip_bounds cfig == AllRoomClipBoundaries
|
||||
= setLayer TopLayer $ color green $ concatMap (polygonWire . _cpPoints) (_roomClipping w)
|
||||
= setLayer DebugLayer $ color green $ concatMap (polygonWire . _cpPoints) (_roomClipping w)
|
||||
| _debug_view_clip_bounds cfig == IntersectingRoomClipBoundaries
|
||||
= setLayer TopLayer $ f (_roomClipping w)
|
||||
= setLayer DebugLayer $ f (_roomClipping w)
|
||||
| otherwise = []
|
||||
where
|
||||
f (x:xs) = g x xs <> f xs
|
||||
|
||||
Reference in New Issue
Block a user