reanimate-1.1.5.0: Animation library based on SVGs.
Safe HaskellNone
LanguageHaskell2010

Reanimate.Effect

Description

Effects represent modifications applied to frames of the Animation. Effects can (and usually do) depend on time. One or more effects can be applied over the entire duration of animation, or modified to affect only a specific portion at the beginning / middle / end of the animation.

Synopsis

Primitive Effects

type Effect Source #

Arguments

 = Duration

Duration of the effect (in seconds)

-> Time

Time elapsed from when the effect started (in seconds)

-> Tree

Image to be modified

-> Tree

Image after modification

An Effect represents a modification of a SVG Tree that can vary with time.

fadeInE :: Effect Source #

Change image opacity from 0 to 1.

fadeOutE :: Effect Source #

Change image opacity from 1 to 0. Reverse of fadeInE.

fadeLineInE :: Double -> Effect Source #

Change stroke width from 0 to given value.

fadeLineOutE :: Double -> Effect Source #

Change stroke width from given value to 0. Reverse of fadeLineInE.

fillInE :: Effect Source #

Change fill opacity from 0 to 1.

drawInE :: Effect Source #

Effect of progressively drawing the image. Note that this will only affect primitive shapes (see pathify).

translateE :: Double -> Double -> Effect Source #

Move the image from its current position to the target x y coordinates.

scaleE :: Double -> Effect Source #

Change scale from 1 to given value.

constE :: (Tree -> Tree) -> Effect Source #

Build an effect from an image-modifying function. This effect does not change as time passes.

Modifying Effects

overBeginning Source #

Arguments

:: Duration

Duration of the initial segment of the animation over which the Effect should be applied

-> Effect

The Effect to modify

-> Effect

Effect which will only affect the initial segment of the animation

Modify the effect so that it only applies to the initial part of the animation.

overEnding Source #

Arguments

:: Duration

Duration of the ending segment of the animation over which the Effect should be applied

-> Effect

The Effect to modify

-> Effect

Effect which will only affect the ending segment of the animation

Modify the effect so that it only applies to the ending part of the animation.

overInterval Source #

Arguments

:: Time

time after start of animation when the effect should start

-> Time

time after start of the animation when the effect should finish

-> Effect

The Effect to modify

-> Effect

Effect which will only affect the specified interval within the animation

Modify the effect so that it only applies within given interval of animation's running time.

reverseE :: Effect -> Effect Source #

reverseE effect starts where the effect ends and vice versa.

delayE :: Duration -> Effect -> Effect Source #

Delay the effect so that it only starts after specified duration and then runs till the end of animation.

aroundCenterE :: Effect -> Effect Source #

Transform the effect so that the image passed to the effect's image-modifying function has coordinates (0, 0) shifted to the center of its bounding box. Also see aroundCenter.

Applying Effects to Animations

applyE :: Effect -> Animation -> Animation Source #

Modify the animation by applying the effect. If desired, you can apply multiple effects to single animation by calling this function multiple times.