Package paintingcanvas.animation
Class MovementAnimation
- java.lang.Object
-
- paintingcanvas.animation.Animation
-
- paintingcanvas.animation.MovementAnimation
-
public class MovementAnimation extends Animation
Controls animation that is to do with position
-
-
Field Summary
Fields Modifier and Type Field Description java.awt.Point
end
boolean
relative
java.awt.Point
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 MovementAnimation(java.awt.Point end)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Animation
copy()
protected void
initAnimation(Drawable<?> drawable)
Initialize the animation with the affected drawableMovementAnimation
relative()
protected void
updateAnimation(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
-
relative
public MovementAnimation relative()
-
updateAnimation
protected void updateAnimation(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<?> drawable)
Description copied from class:Animation
Initialize the animation with the affected drawable- Specified by:
initAnimation
in classAnimation
- Parameters:
drawable
- The affected drawable
-
-