Class PathAnimation

  • All Implemented Interfaces:
    TimerListener

    public class PathAnimation
    extends ControlAnimation
    Creates an animation that follows a path.
    Since:
    TotalCross 3.03
    • Method Detail

      • create

        public static PathAnimation create​(Control c,
                                           int toX,
                                           int toY,
                                           ControlAnimation.AnimationFinished animFinish,
                                           int totalTime)
        Creates a path animation, moving the control to the given x and y positions.
        Parameters:
        c - The control to be moved
        toX - The destination X coordinate
        toY - The destination Y coordinate
        animFinish - An interface method to be called when the animation finished, or null if none.
        totalTime - The total time in millis that the animation will take, or -1 to use the default value (800ms).
      • create

        public static PathAnimation create​(Control c,
                                           int fromX,
                                           int fromY,
                                           int toX,
                                           int toY,
                                           ControlAnimation.AnimationFinished animFinish,
                                           int totalTime)
        Creates a path animation, moving the control from a position to another.
        Parameters:
        c - The control to be moved
        fromX - The origin X coordinate
        fromY - The origin Y coordinate
        toX - The destination X coordinate
        toY - The destination Y coordinate
        animFinish - An interface method to be called when the animation finished, or null if none.
        totalTime - The total time in millis that the animation will take, or -1 to use the default value (800ms).
      • create

        public static PathAnimation create​(Control c,
                                           int direction,
                                           ControlAnimation.AnimationFinished animFinish,
                                           int totalTime)
        Creates a path animation, moving the control in a direction.
        Parameters:
        c - The control to be moved
        direction - One of BOTTOM, -BOTTOM, TOP, -TOP, LEFT, -LEFT, RIGHT, -RIGHT. Any other value will return null.
        animFinish - An interface method to be called when the animation finished, or null if none.
        totalTime - The total time in millis that the animation will take, or -1 to use the default value (800ms).