Play around with alpha blending

This commit is contained in:
2025-11-04 10:42:18 +00:00
parent 833d4562e2
commit 05c530eeb1
4 changed files with 30 additions and 36 deletions
+5 -4
View File
@@ -2,6 +2,7 @@
module Dodge.Render.HUD (drawHUD) where
import Linear
import Dodge.Clock
import qualified Data.Vector as V
import Dodge.Terminal
@@ -118,7 +119,7 @@ drawMouseOver cfig w =
<|> w ^? input . mouseContext . mcoInvFilt
sss <- w ^? hud . diSections
return . translateScreenPos cfig (invDP ^. ldpPos)
. color (withAlpha 0.1 white)
. color (0.3*^white)
-- . color white
$ selSecDrawCursorAt invDP curs sss (j, i)
-- curs = BoundaryCursor [West]
@@ -130,7 +131,7 @@ drawMouseOver cfig w =
sss <- w ^? hud . subInventory . ciSections
let idp = secondColumnLDP
return . translateScreenPos cfig (idp ^. ldpPos)
. color (withAlpha 0.2 white)
. color (0.3*white)
$ selSecDrawCursorAt idp curs sss (j, i)
drawDragSelected :: Config -> World -> Maybe Picture
@@ -146,7 +147,7 @@ drawDragSelected cfig w = do
sss <- w ^? hud . diSections
let f x = (selSecDrawCursorAt invDP BackdropCursor sss (i, x) <>)
return . translateScreenPos cfig (invDP ^. ldpPos)
. color (withAlpha 0.2 white)
. color (0.2*^white)
. IS.foldr f mempty
$ ys
@@ -156,7 +157,7 @@ drawDragSelecting cfig w = do
sss <- w ^? hud . diSections
let f x = selSecDrawCursorAt invDP BackdropCursor sss (i, x)
return . translateScreenPos cfig (invDP ^. ldpPos)
. color (withAlpha 0.2 white)
. color (0.2*^white)
. foldMap f
$ [min j b .. max j b]