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 AnimationCurve
protected T
protected T
protected float
Fields 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 float
Restarts the animation and returns the current value.getUpdatedValue
(float deltaTime) Updates the animation and returns the current value.boolean
void
restart()
void
setDuration
(float duration) void
update
(float deltaTime) Progresses the animation.Methods inherited from class dev.prozilla.pine.common.property.VariableProperty
getValue
-
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
-