public final class BasicTextAnimation extends AbstractAnimation
Animation
,
BasicTextLabel
,
AnimationFunction
,
AnimationFunctions
Constructor and Description |
---|
BasicTextAnimation(BasicTextLabel label,
long duration,
String text,
AnimationFunction<Color> colorFunction,
AnimationFunction<Float> scaleXFunction,
AnimationFunction<Float> scaleYFunction,
AnimationFunction<Float> spaceFunction)
Constructs a text animation that fades in a text, scales it and
fades it out.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyEffect(long time)
Applies the effect: sets color, spacing, scaling and offset,
the latter only if enabled.
|
static AnimationFunction<Color> |
cinemaFadeColorFunction(long duration,
Color baseColor)
Creates and returns the color animation function for the default fade.
|
static BasicTextAnimation |
defaultFade(BasicTextLabel label,
long duration,
String text,
Color baseColor)
Creates and returns an animation for a text fade-in and -out.
|
static AnimationFunction<Color> |
defaultFadeColorFunction(long duration,
Color baseColor)
Creates and returns the color animation function for the default fade.
|
static AnimationFunction<Integer> |
defaultOffsetFunction()
Returns the animation function for the default random position offset.
|
static BasicTextAnimation |
defaultScale(BasicTextLabel label,
long duration,
String text,
Color baseColor)
Creates and answers an animation, that provides a text fade-in
and -out and scales the text while fading out.
|
static AnimationFunction<Color> |
defaultScaleColorFunction(long duration,
Color baseColor)
Creates and returns the animation function for the default scaling.
|
static AnimationFunction<Float> |
defaultScaleFunction(long duration)
Creates and returns the default scaling animation function.
|
static BasicTextAnimation |
defaultSpace(BasicTextLabel label,
long duration,
String text,
Color baseColor)
Creates and answers an animation, that provides a text fade-in
and -out and increases the glyph spacing.
|
static AnimationFunction<Color> |
defaultSpaceColorFunction(long duration,
Color baseColor)
Creates and answers the color animation function for
the default spacing animation.
|
static AnimationFunction<Float> |
defaultSpaceFunction(long duration)
Creates and returns the default spacing animation function.
|
boolean |
isOffsetEnabled()
Answers whether the random position offset is enabled.
|
void |
setOffsetEnabled(boolean b)
Enables or disables the random position offset.
|
addAnimationListener, animate, duration, fireAnimationStarted, fireAnimationStopped, isFreezed, removeAnimationListener, toString
public BasicTextAnimation(BasicTextLabel label, long duration, String text, AnimationFunction<Color> colorFunction, AnimationFunction<Float> scaleXFunction, AnimationFunction<Float> scaleYFunction, AnimationFunction<Float> spaceFunction)
label
- the animation target componentduration
- the animation durationtext
- the text to fade incolorFunction
- the animation function for the colorscaleXFunction
- the animation function for the horizontal scalescaleYFunction
- the animation function for the vertical scalespaceFunction
- the animation function for the glyph spacepublic static BasicTextAnimation defaultFade(BasicTextLabel label, long duration, String text, Color baseColor)
label
- the animation target componentduration
- the animation durationtext
- the text to fade inbaseColor
- the base color for the fade effectpublic static BasicTextAnimation defaultScale(BasicTextLabel label, long duration, String text, Color baseColor)
label
- the animation target componentduration
- the animation durationtext
- the text to fade inbaseColor
- the base color for the fade effectpublic static BasicTextAnimation defaultSpace(BasicTextLabel label, long duration, String text, Color baseColor)
label
- the animation target componentduration
- the animation durationtext
- the text to fade inbaseColor
- the base color for the fade effectpublic static AnimationFunction<Color> defaultFadeColorFunction(long duration, Color baseColor)
duration
- the animation durationbaseColor
- the base color for the fade effectpublic static AnimationFunction<Color> cinemaFadeColorFunction(long duration, Color baseColor)
duration
- the animation durationbaseColor
- the base color for the fade effectpublic static AnimationFunction<Color> defaultScaleColorFunction(long duration, Color baseColor)
duration
- the animation durationbaseColor
- the base color for the fade effectpublic static AnimationFunction<Color> defaultSpaceColorFunction(long duration, Color baseColor)
duration
- the animation durationbaseColor
- the base color for the fade effectpublic static AnimationFunction<Integer> defaultOffsetFunction()
public static AnimationFunction<Float> defaultScaleFunction(long duration)
duration
- the animation durationpublic static AnimationFunction<Float> defaultSpaceFunction(long duration)
duration
- the animation durationprotected void applyEffect(long time)
applyEffect
in class AbstractAnimation
time
- the render timepublic boolean isOffsetEnabled()
public void setOffsetEnabled(boolean b)
b
- the new enablementCopyright © 2018 JGoodies Software GmbH. All rights reserved.