Center and rotate to horizontal sound text
This commit is contained in:
@@ -78,7 +78,14 @@ soundPic :: World -> Sound -> Picture
|
|||||||
soundPic w s = fixedSizePicClampArrow 50 50 thePic p w
|
soundPic w s = fixedSizePicClampArrow 50 50 thePic p w
|
||||||
where
|
where
|
||||||
p = _soundPos s
|
p = _soundPos s
|
||||||
thePic = scale 0.15 0.15 $ text $ soundToOnomato $ _soundChunkID s
|
thePic
|
||||||
|
= rotate (_cameraRot w)
|
||||||
|
. scale theScale theScale
|
||||||
|
. centerText
|
||||||
|
. soundToOnomato
|
||||||
|
$ _soundChunkID s
|
||||||
|
theScale = 0.15 * f (_soundVolume s * 0.0001)
|
||||||
|
f x = 1 - 0.5 * (1 - x)
|
||||||
|
|
||||||
crDraw :: World -> Creature -> Picture
|
crDraw :: World -> Creature -> Picture
|
||||||
crDraw w c = _crPict c c w
|
crDraw w c = _crPict c c w
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ moveFlame rotd w pt
|
|||||||
_ -> (glare $ doSound damcrs , mvPt)
|
_ -> (glare $ doSound damcrs , mvPt)
|
||||||
where
|
where
|
||||||
time = _btTimer' pt
|
time = _btTimer' pt
|
||||||
doSound = soundContinue Flame (V2 x y) fireS (Just 2) -- . over worldEvents ((.) $ flameGlareAt ep)
|
doSound = soundContinue Flame (V2 x y) fireLoudS (Just 2) -- . over worldEvents ((.) $ flameGlareAt ep)
|
||||||
glare
|
glare
|
||||||
| time `mod` 5 == 0
|
| time `mod` 5 == 0
|
||||||
= tempLightSources %~ (theTLS :)
|
= tempLightSources %~ (theTLS :)
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ module Picture
|
|||||||
, line
|
, line
|
||||||
, lineCol
|
, lineCol
|
||||||
, text
|
, text
|
||||||
|
, centerText
|
||||||
, pictures
|
, pictures
|
||||||
, concatMapPic
|
, concatMapPic
|
||||||
, appendPic
|
, appendPic
|
||||||
@@ -244,6 +245,10 @@ circle :: Float -> Picture
|
|||||||
{-# INLINE circle #-}
|
{-# INLINE circle #-}
|
||||||
circle rad = thickArc 0 (2*pi) rad 1
|
circle rad = thickArc 0 (2*pi) rad 1
|
||||||
|
|
||||||
|
centerText :: String -> Picture
|
||||||
|
{-# INLINE centerText #-}
|
||||||
|
centerText s = translate (25 * (negate . fromIntegral $ length s)) 0 $ text s
|
||||||
|
|
||||||
text :: String -> Picture
|
text :: String -> Picture
|
||||||
{-# INLINE text #-}
|
{-# INLINE text #-}
|
||||||
text s = map f $ stringToList s
|
text s = map f $ stringToList s
|
||||||
|
|||||||
Reference in New Issue
Block a user