This commit is contained in:
2023-05-10 20:32:26 +01:00
parent 312f342e09
commit 5f238a65d0
9 changed files with 96 additions and 92 deletions
+9 -4
View File
@@ -25,6 +25,8 @@ module Picture.Base (
line,
lineCol,
text,
textJustifyRight,
textVMirror,
drawText,
centerText,
stackText,
@@ -45,7 +47,6 @@ module Picture.Base (
mirrorxz,
overPos,
picMap,
vMirrorText,
) where
import Color
@@ -200,15 +201,19 @@ stackText :: [String] -> Picture
{-# INLINE stackText #-}
stackText = mconcat . zipWith (\y s -> translate 0 y $ centerText s) [0, 100 ..]
textJustifyRight :: String -> Picture
{-# INLINE textJustifyRight #-}
textJustifyRight str = translate ((-100) * fromIntegral (length str)) 0 $ text str
text :: String -> Picture
{-# INLINE text #-}
--text = translate (-50) (-100) . drawText (-10)
text = drawText 0
--text = drawText (-10)
vMirrorText :: String -> Picture
{-# INLINE vMirrorText #-}
vMirrorText = translate 0 200 . scale 1 (-1) . text
textVMirror :: String -> Picture
{-# INLINE textVMirror #-}
textVMirror = translate 0 200 . scale 1 (-1) . text
drawText :: Float -> String -> [Verx]
{-# INLINE drawText #-}