Safe Haskell | None |
---|---|
Language | Haskell98 |
Extras.Animation
Synopsis
- type Animation = Number -> Picture
- type Duration = Number
- type Script = (Duration, Animation)
- scriptOf :: Script -> Effect
- forAsLongAs :: (Script, Script) -> Script
- repeatedly :: Script -> Script
- speedup :: (Number, Script) -> Script
- shortlived :: Script -> Script
- slowstart :: (Duration, Script) -> Script
- slowend :: Script -> Script
- timeReversed :: Script -> Script
- delayed :: (Duration, Script) -> Script
- shifted :: (Duration, Script) -> Script
- frameAt :: (Number, Script) -> Picture
- frameAtEnd :: Script -> Picture
- durationOf :: Script -> Duration
- sequential :: [Script] -> Script
- simultaneous :: [Script] -> Script
- incremental :: [Script] -> Script
- static :: Picture -> Script
- animated :: (Picture, [Motion]) -> Script
- extended :: (Script, [Motion]) -> Script
- coincidental :: (Motion, Script) -> Script
- play :: [Motion] -> Motion
- (>>) :: Motion -> Motion -> Motion
- moving :: (Duration, Number, Number) -> Motion
- turning :: (Duration, Number, Number, Number) -> Motion
- radiating :: (Duration, Number, Number, Number, Number) -> Motion
- coloring :: (Duration, Color) -> Motion
- fading :: (Duration, Color) -> Motion
- waiting :: Duration -> Motion
- hiding :: Duration -> Motion
- gone :: Motion
- replacing :: Script -> Motion
Documentation
type Animation = Number -> Picture #
You can simulate motion by specifying slightly different pictures at different instants in time (measured in seconds). Thus, an animation is just a function of time that specifies which picture to show at each time.
forAsLongAs :: (Script, Script) -> Script #
A script that repeats for as long as the first argument runs
repeatedly :: Script -> Script #
A script that repeats for as long as the first argument indicates
speedup :: (Number, Script) -> Script #
A script that runs faster (`factor > 1`) or slower (`factor < 1`) than the original.
shortlived :: Script -> Script #
A script that goes away when it finishes
slowstart :: (Duration, Script) -> Script #
A script that waits at the first frame some time before starting
timeReversed :: Script -> Script #
A script that goes backwards in time
frameAtEnd :: Script -> Picture #
Extract the last frame from a script
durationOf :: Script -> Duration #
Duration of a script
sequential :: [Script] -> Script #
Scripts that run one at a time
simultaneous :: [Script] -> Script #
Scripts that run at the same time
incremental :: [Script] -> Script #
Like sequential, but the previous script stays on
coincidental :: (Motion, Script) -> Script #
Apply a motion to a currently playing script
moving :: (Duration, Number, Number) -> Motion #
Translate by the given units to the right and upwards
turning :: (Duration, Number, Number, Number) -> Motion #
Rotate around a pivot `(cx,cy)` by the given angle