Class AnimatedProperty<T>

java.lang.Object
dev.prozilla.pine.common.property.VariableProperty<T>
dev.prozilla.pine.common.property.animated.AnimatedProperty<T>
Direct Known Subclasses:
AnimatedColorProperty, AnimatedColorProperty.AnimatedAlpha, AnimatedDimensionProperty, AnimatedDualDimensionProperty, AnimatedFloatProperty, AnimatedIntProperty, TransitionedProperty

public abstract class AnimatedProperty<T> extends VariableProperty<T>
A property with a value that changes over time.
  • Field Details

    • start

      protected T start
    • end

      protected T end
    • curve

      protected final AnimationCurve curve
    • time

      protected float time
  • Constructor Details

    • AnimatedProperty

      public AnimatedProperty(T start, T end, AnimationCurve curve)
      Creates a property with an animation.
      Parameters:
      start - Value at the start of the animation
      end - Value at the end of the animation
  • Method Details

    • getRestartedValue

      public T getRestartedValue()
      Restarts the animation and returns the current value.
    • restart

      public void restart()
    • getUpdatedValue

      public T getUpdatedValue(float deltaTime)
      Updates the animation and returns the current value.
      Parameters:
      deltaTime - Delta time in seconds.
    • update

      public void update(float deltaTime)
      Progresses the animation.
      Parameters:
      deltaTime - How far to progress the animation, in seconds
    • getFactor

      protected float getFactor()
    • hasFinished

      public boolean hasFinished()
    • setDuration

      public void setDuration(float duration)
    • getCurve

      public AnimationCurve getCurve()