Use V2 instead of tuples and rename 'sceneAnimation' to 'scene'. (#165)

This commit is contained in:
David Himmelstrup 2020-09-19 22:17:51 +08:00 committed by GitHub
commit d37e71ca94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
68 changed files with 140 additions and 214 deletions

View file

@ -23,7 +23,7 @@ import "random-shuffle" System.Random.Shuffle
main :: IO ()
main = reanimate $ sceneAnimation $ do
main = reanimate $ scene $ do
newSpriteSVG $ mkBackgroundPixel $ PixelRGBA8 252 252 252 0xFF
zPos <- newVar 0
xRot <- newVar 0
@ -93,7 +93,7 @@ polygon {
latexExample :: Animation
latexExample = sceneAnimation $ do
latexExample = scene $ do
-- Draw equation
play $ drawAnimation strokedSvg
sprites <- forM glyphs $ \(fn, _, elt) ->
@ -143,7 +143,7 @@ drawAnimation :: SVG -> Animation
drawAnimation = drawAnimation' Nothing 0.5 0.3
drawAnimation' :: Maybe Int -> Double -> Double -> SVG -> Animation
drawAnimation' mbSeed fillDur step svg = sceneAnimation $ do
drawAnimation' mbSeed fillDur step svg = scene $ do
forM_ (zip [0..] $ shuf $ svgGlyphs svg) $ \(n, (fn, attr, tree)) -> do
let sWidth =
case toUserUnit defaultDPI <$> getLast (attr ^. strokeWidth) of