Add depth clear/check to fixed layer pictures

This commit is contained in:
2024-11-17 20:01:17 +00:00
parent d5be125a3b
commit afddcae6d1
7 changed files with 185 additions and 207 deletions
-2
View File
@@ -2,8 +2,6 @@
module Dodge.Render.HUD (
drawHUD,
selNumPos, -- this shoud probably be pushed back here
selNumPosCardinal, -- this shoud probably be pushed back here
) where
import Control.Applicative
+18 -13
View File
@@ -1,4 +1,5 @@
{-# LANGUAGE LambdaCase #-}
module Dodge.Render.List (
renderListAt,
drawList,
@@ -17,13 +18,13 @@ module Dodge.Render.List (
drawCursorAt,
) where
import Dodge.ListDisplayParams
import qualified Data.IntMap.Strict as IM
import Data.Maybe
import Dodge.Base.Window
import Dodge.Data.CardinalPoint
import Dodge.Data.Config
import Dodge.Data.SelectionList
import Dodge.ListDisplayParams
import Dodge.ScreenPos
import Dodge.SelectionSections
import Geometry
@@ -39,22 +40,24 @@ drawSelectionList ldps cfig sl =
(ldps ^. ldpScale)
0
(makeSelectionListPictures sl)
-- <> drawCursorAt
-- (sl ^. slSelPos)
-- (sl ^. slItems)
-- ldps
-- (BoundaryCursor [North, South])
drawTitleBackground :: Configuration -> Picture
drawTitleBackground cfig =
translateScreenPos cfig (fromTopLeft (V2 (subInvX - 5) 75))
. polygon . reverse $ rectNSWE 70 0 0 560
. polygon
. reverse
$ rectNSWE 70 0 0 560
drawSelectionListBackground :: ListDisplayParams -> Configuration ->
Int -- list length
-> Picture
drawSelectionListBackground ldp cfig l = translateScreenPos cfig (ldp ^. ldpPos) .
polygon . reverse $ rectNSWE 5 s (-5) e
drawSelectionListBackground ::
ListDisplayParams ->
Configuration ->
Int -> -- list length
Picture
drawSelectionListBackground ldp cfig l =
translateScreenPos cfig (ldp ^. ldpPos)
. polygon
. reverse
$ rectNSWE 5 s (-5) e
where
s = - (5 + fromIntegral l * (20 * ldp ^. ldpScale + ldp ^. ldpVerticalGap))
e = 555 -- HACK isOverTerminalScreen
@@ -191,7 +194,9 @@ drawListElement ygap s xint yint =
. scale (s * 0.1) (s * 0.1)
renderListAt :: Float -> Float -> [(String, Color)] -> Picture
renderListAt tx ty = translate tx (- ty) . drawList . map (\(str, col) -> color col $ text str)
renderListAt tx ty = translate tx (- ty)
. drawList
. map (\(str, col) -> color col $ text str)
--inverseText :: String -> Color -> Picture
--inverseText str col =
+1
View File
@@ -74,6 +74,7 @@ drawMouseCursor :: Universe -> Picture
drawMouseCursor u =
uncurryV translate (u ^. uvWorld . input . mousePos)
. color white
. setDepth 1
$ mouseCursorType u
mouseCursorType :: Universe -> Picture