FlixelNumTween
View sourceclass
org.flixelgdx.tween.type.FlixelNumTween
Tween type that tweens one numerical value to another.
Constructors
FlixelNumTween(float, float, FlixelTweenSettings, UpdateCallback)
Constructs a new numerical tween, which will tween a simple starting number to an ending value.
Parameters:
| Name | Description |
|---|---|
start | The starting value. |
end | The ending value. |
settings | The settings that configure and determine how the tween should animate. |
updateCallback | Callback function for updating any variable that needs the current value when the tween updates. |
Fields
start
The starting value of the tween.
end
The target value of the tween.
value
The current value of the tween.
range
The range between the start and end values.
updateCallback
Callback function for updating the value when the tween updates.
Methods
setTarget(float, float, UpdateCallback)
Reconfigures this tween for reuse (e.g. from pool). Call before FlixelNumTween.start().
Parameters:
| Name | Description |
|---|---|
from | Start value. |
to | End value. |
updateCallback | Callback for each updated value. |
Returns: this, for chaining.
isTweenOf(Object, String)
updateTweenValues()
UpdateCallback
interface
org.flixelgdx.tween.type.FlixelNumTween.UpdateCallback
Functional interface for updating the numerical value when the tween updates. This is for updating any variable that needs the current value of the tween.
Methods
update(float)
A callback method that is called when the tween updates its value during its tweening (or animating) process.
Parameters:
| Name | Description |
|---|---|
value | The new current value of the numerical tween during the animation. |