Work on inventory ui

This commit is contained in:
2023-05-14 22:22:21 +01:00
parent 3499384d38
commit 1cec50c5ab
9 changed files with 150 additions and 165 deletions
+5 -6
View File
@@ -10,11 +10,10 @@ fromTopLeft :: Point2 -> ScreenPos
fromTopLeft (V2 x y) = ScreenPos (V2 (-0.5) 0.5) (V2 x (- y))
translateScreenPos :: Configuration -> ScreenPos -> Picture -> Picture
translateScreenPos cfig sp = translate x y
where
V2 x y = sp ^. spScreenOff * V2 w h + sp ^. spPixelOff
w = fromIntegral $ cfig ^. windowX
h = fromIntegral $ cfig ^. windowY
translateScreenPos cfig = uncurryV translate . screenPosAbs cfig
screenPosAbs :: Configuration -> ScreenPos -> Point2
screenPosAbs = undefined
screenPosAbs cfig sp = sp ^. spScreenOff * V2 w h + sp ^. spPixelOff
where
w = fromIntegral $ cfig ^. windowX
h = fromIntegral $ cfig ^. windowY