Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Timeline

[9:7] extends: FxObj

Represents a JavaFX Timeline, a keyframe-based animation. Add keyframes with addKeyFrame() then call play().

Methods

  • Timeline ()

    Creates a new Timeline with no keyframes.

  • addKeyFrame (double Millis, callback OnFinished)

    Adds a keyframe at the specified time with a callback.

    • @p Millis is a double with the time in milliseconds.
    • @p OnFinished is a callback called when this keyframe is reached.
    • @r this object for chaining
  • setCycleCount (int Count)

    Sets the number of times the timeline cycles before stopping.

    • @p Count is an int with the cycle count; pass -1 for indefinite looping.
    • @r this object.
  • setAutoReverse (bool Auto)

    Sets whether the timeline reverses direction on alternating cycles.

    • @p Auto is a bool; true enables auto-reverse.
    • @r this object.
  • play ()

    Starts playing the timeline.

    • @r this object.
  • stop ()

    Stops the timeline.

    • @r this object.
  • setOnFinished (callback OnFinished)

    Registers a callback to invoke when the timeline finishes all cycles.

    • @p OnFinished is a callback invoked with an ActionEvent when the timeline completes.
    • @r this object.