Class 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 frames
        Easing easing
        The easing function to use
        int 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 drawable
      MovementAnimation 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)
        Create an animation that changes the color of this to the specified color.
        static ColorAnimation colorTo​(int r, int g, int b)
        Create an animation that changes the color of this to the specified color.
        static ColorAnimation colorTo​(int r, int g, int b, int a)
        Create an animation that changes the color of this to the specified color.
        static Animation colorTo​(java.awt.Color color)
        Create an animation that changes the color of this to the specified color.
        static ColorAnimation colorTo​(java.lang.String name)
        Create an animation that changes the color of this to the specified color.
        static ColorAnimation colorTo​(Hue hue)
        Create an animation that changes the color of this to the specified color.
        abstract Animation copy()  
        Animation easing​(Easing easing)
        Sets the easing to be used by this animation
        boolean ended​(int frame)  
        static OpacityAnimation fadeIn()
        Create an animation that fades this in.
        static OpacityAnimation fadeOut()
        Create an animation that fades this out.
        protected abstract void initAnimation​(Drawable<?> drawable)
        Initialize the animation with the affected drawable
        static MovementAnimation moveBy​(int x, int y)
        Create an animation that moves this by the specified x and y
        static MovementAnimation moveHorizontalBy​(int x)
        Create an animation that moves this by the specified x horizontally.
        static MovementAnimation moveTo​(int x, int y)
        Create an animation that moves this to the specified x and y
        static MovementAnimation moveVerticalBy​(int y)
        Create an animation that moves this by the specified y vertically.
        static RotationAnimation rotateBy​(double angle)
        Create an animation that rotates this by angle degrees.
        static RotationAnimation rotateTo​(double angle)
        Create an animation that rotates this to the specified angle degrees.
        void update​(int frame)
        Updates the animation with the current frame
        protected abstract void updateAnimation​(Drawable<?> drawable, double progress)
        update the animation with the progress (0-1) and affected drawable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • end

        public java.awt.Point end
      • start

        public java.awt.Point start
      • relative

        public boolean relative
    • Constructor Detail

      • MovementAnimation

        public MovementAnimation​(java.awt.Point end)
    • Method Detail

      • 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 class Animation
        Parameters:
        drawable - The affected drawable
        progress - 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 class Animation
        Parameters:
        drawable - The affected drawable