public class Interpolator
extends java.lang.Object
Timer
.
Currently, it performs linear interpolation but we may add support for custom curves and ease in / ease out behavior.
Constructor and Description |
---|
Interpolator(java.util.function.Supplier<java.lang.Integer> input,
java.util.function.Consumer<? super java.lang.Integer> output)
Creates a new instance of
Interpolator . |
Modifier and Type | Method and Description |
---|---|
int |
getTarget()
Gets the ultimate target value (or the current value if there's no target).
|
void |
setTarget(int value,
int delay)
Adds a new target value.
|
public Interpolator(java.util.function.Supplier<java.lang.Integer> input, java.util.function.Consumer<? super java.lang.Integer> output)
Interpolator
.input
- a getter of the valueoutput
- a setter of the valuepublic void setTarget(int value, int delay)
value
- target valuedelay
- initial delaypublic int getTarget()