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
A property with a value that changes over time.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AnimationCurveprotected Tprotected Tprotected floatFields inherited from class dev.prozilla.pine.common.property.VariableProperty
random -
Constructor Summary
ConstructorsConstructorDescriptionAnimatedProperty(T start, T end, AnimationCurve curve) Creates a property with an animation. -
Method Summary
Modifier and TypeMethodDescriptiongetCurve()protected floatRestarts the animation and returns the current value.getUpdatedValue(float deltaTime) Updates the animation and returns the current value.booleanvoidrestart()voidsetDuration(float duration) voidupdate(float deltaTime) Progresses the animation.
-
Field Details
-
start
-
end
-
curve
-
time
protected float time
-
-
Constructor Details
-
AnimatedProperty
Creates a property with an animation.- Parameters:
start- Value at the start of the animationend- Value at the end of the animation
-
-
Method Details
-
getRestartedValue
Restarts the animation and returns the current value. -
restart
public void restart() -
getUpdatedValue
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
-