codeworld-base-0.2.0.0: Replacement base module for CodeWorld

Safe HaskellNone
LanguageHaskell98

Extras.Animation

Synopsis

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.

scriptOf :: Script -> Effect #

A delimited animation

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

slowend :: Script -> Script #

A script that stays frozen at the last frame after it ends

timeReversed :: Script -> Script #

A script that goes backwards in time

delayed :: (Duration, Script) -> Script #

A script that waits some time before starting

shifted :: (Duration, Script) -> Script #

A script that starts the given duration in

frameAt :: (Number, Script) -> Picture #

Extract the given frame from a script

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

static :: Picture -> Script #

A Picture converted into a Script

animated :: (Picture, [Motion]) -> Script #

Apply a sequence of motions to the given picture

extended :: (Script, [Motion]) -> Script #

Apply a sequence of motions to an existing script

coincidental :: (Motion, Script) -> Script #

Apply a motion to a currently playing script

play :: [Motion] -> Motion #

A motion that is a combination of a sequence of motions

(>>) :: Motion -> Motion -> Motion infixl 7 #

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

radiating :: (Duration, Number, Number, Number, Number) -> Motion #

Scale with center of similarity at `(cx,cy)` and factors `(sx,sy)`

coloring :: (Duration, Color) -> Motion #

Ramp color up from transparent to given color

fading :: (Duration, Color) -> Motion #

Ramp color down from given color to transparent

waiting :: Duration -> Motion #

Make a script last for the given duration

hiding :: Duration -> Motion #

Do not show the script for the given duration

gone :: Motion #

Replace the script with a blank

replacing :: Script -> Motion #

Replace the script with the given one