Package paintingcanvas.animation
Class OpacityAnimation
- java.lang.Object
-
- paintingcanvas.animation.Animation
-
- paintingcanvas.animation.OpacityAnimation
-
public class OpacityAnimation extends Animation
Controls animation that is to do with opacity
-
-
Field Summary
Fields Modifier and Type Field Description int
end
int
outlineStart
int
start
-
Fields inherited from class paintingcanvas.animation.Animation
Modifier and Type Field Description int
duration
The length of the animation in framesEasing
easing
The easing function to useint
startFrame
The frame at which the animation should start
-
-
Constructor Summary
Constructors Constructor Description OpacityAnimation(double end)
OpacityAnimation(int end)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Animation
copy()
protected void
initAnimation(Drawable<? extends Drawable<?>> drawable)
Initialize the animation with the affected drawableprotected void
updateAnimation(Drawable<? extends Drawable<?>> drawable, double progress)
update the animation with the progress (0-1) and affected drawable-
Methods inherited from class paintingcanvas.animation.Animation
Modifier and Type Method Description static ColorAnimation
colorTo(int hex)
Creates an animation that changes the color ofthis
to the specifiedcolor
overduration
seconds.static ColorAnimation
colorTo(int r, int g, int b)
Creates an animation that changes the color ofthis
to the specifiedcolor
overduration
seconds.static Animation
colorTo(java.awt.Color color)
Creates an animation that changes the color ofthis
to the specifiedcolor
overduration
seconds.abstract Animation
copy()
Animation
easing(Easing easing)
Sets the easing to be used by this animationboolean
ended(int frame)
static OpacityAnimation
fadeIn()
Creates an animation that fadesthis
in over @{code duration} seconds.static OpacityAnimation
fadeOut()
Creates an animation that fadesthis
out over @{code duration} seconds.protected abstract void
initAnimation(Drawable<?> drawable)
Initialize the animation with the affected drawablestatic MovementAnimation
moveBy(int x, int y)
Creates an animation that movesthis
by the specifiedx
andy
static MovementAnimation
moveTo(int x, int y)
Creates an animation that movesthis
to the specifiedx
andy
overduration
secondsstatic RotationAnimation
rotateBy(int angle)
Creates an animation that rotatesthis
byangle°
.static RotationAnimation
rotateTo(int angle)
Creates an animation that rotatesthis
to the specifiedangle°
.void
update(int frame)
Updates the animation with the current frameprotected abstract void
updateAnimation(Drawable<?> drawable, double progress)
update the animation with the progress (0-1) and affected drawable
-
-
-
-
Method Detail
-
updateAnimation
protected void updateAnimation(Drawable<? extends Drawable<?>> drawable, double progress)
Description copied from class:Animation
update the animation with the progress (0-1) and affected drawable- Specified by:
updateAnimation
in classAnimation
- Parameters:
drawable
- The affected drawableprogress
- Animation progress (0-1)
-
initAnimation
protected void initAnimation(Drawable<? extends Drawable<?>> drawable)
Description copied from class:Animation
Initialize the animation with the affected drawable- Specified by:
initAnimation
in classAnimation
- Parameters:
drawable
- The affected drawable
-
-