Polish object interface (#138)

This commit is contained in:
David Himmelstrup 2020-08-25 13:51:32 +08:00 committed by GitHub
commit 83e4ecd987
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 261 additions and 85 deletions

19
examples/doc_spriteScope.hs Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env stack
-- stack runghc --package reanimate
module Main(main) where
import Reanimate
import Reanimate.Builtin.Documentation
main :: IO ()
main = reanimate $ docEnv $ sceneAnimation $ do
-- the rect lives through the entire 3s animation
newSpriteSVG_ $ translate (-3) 0 $ mkRect 4 4
wait 1
spriteScope $ do
-- the circle only lives for 1 second.
local <- newSpriteSVG $ translate 3 0 $ mkCircle 2
spriteE local $ overBeginning 0.3 fadeInE
spriteE local $ overEnding 0.3 fadeOutE
wait 1
wait 1