| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Imj.Graphics.Text.Animation
Description
Examples
Examples are available in Imj.Example.SequentialTextTranslationsAnchored:
- Run
imj-base-examples-exeto see these examples displayed in the terminal
- data TextAnimation a = TextAnimation {}
- data AnchorChars
- data AnchorStrings
- mkTextTranslation :: ColorString -> Float -> Coords Pos -> Coords Pos -> TextAnimation AnchorChars
- mkSequentialTextTranslationsCharAnchored :: [([ColorString], Coords Pos, Coords Pos)] -> Float -> TextAnimation AnchorChars
- mkSequentialTextTranslationsStringAnchored :: [([ColorString], Coords Pos, Coords Pos)] -> Float -> TextAnimation AnchorStrings
- renderAnimatedTextCharAnchored :: (Draw e, MonadReader e m, MonadIO m) => TextAnimation AnchorChars -> Frame -> m ()
- renderAnimatedTextStringAnchored :: (Draw e, MonadReader e m, MonadIO m) => TextAnimation AnchorStrings -> Frame -> m ()
- module Imj.Graphics.Interpolation
TextAnimation
Interpolates between various ColorStrings, and at the same time interpolates
their anchors.
Anchors interpolation can occur :
- at the
ColorStringlevel usingAnchorStrings, or - at the
Charlevel usingAnchorChars
data TextAnimation a Source #
Interpolates ColorStrings and anchors.
Constructors
| TextAnimation | |
Fields | |
Instances
| Show (TextAnimation a) Source # | |
data AnchorChars Source #
One anchor per Character
data AnchorStrings Source #
One anchor per String
Constructors
Arguments
| :: ColorString | |
| -> Float | Duration in seconds |
| -> Coords Pos | Left anchor at the beginning |
| -> Coords Pos | Left anchor at the end |
| -> TextAnimation AnchorChars |
Translates a ColorString between two anchors.
mkSequentialTextTranslationsCharAnchored Source #
Arguments
| :: [([ColorString], Coords Pos, Coords Pos)] | List of (texts, from anchor, to anchor) |
| -> Float | duration in seconds |
| -> TextAnimation AnchorChars |
Translates text in an animated way,ete character by character.
Examples are given in Imj.Example.SequentialTextTranslationsAnchored.
mkSequentialTextTranslationsStringAnchored Source #
Arguments
| :: [([ColorString], Coords Pos, Coords Pos)] | List of (texts, from anchor, to anchor) |
| -> Float | Duration in seconds |
| -> TextAnimation AnchorStrings |
Translates text in an animated way, ColorString by ColorString.
Examples are given in Imj.Example.SequentialTextTranslationsAnchored.
Draw
renderAnimatedTextCharAnchored :: (Draw e, MonadReader e m, MonadIO m) => TextAnimation AnchorChars -> Frame -> m () Source #
Render a char-anchored TextAnimation for a given Frame
renderAnimatedTextStringAnchored :: (Draw e, MonadReader e m, MonadIO m) => TextAnimation AnchorStrings -> Frame -> m () Source #
Render a string-anchored TextAnimation for a given Frame
Reexports
module Imj.Graphics.Interpolation