Constructor
new TweenManager()
The tween manager to update value(s) smoothly.
- Source:
Methods
lerpTo(from, to, durationopt, delayTimeopt, options) → {LerpToResult}
Start lerp to.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
from |
Number | Object | The source. | ||||||||||||
to |
Number | Object | The target. | ||||||||||||
duration |
Number |
<optional> |
1000 | The lerp time in milliseconds. | ||||||||||
delayTime |
Number |
<optional> |
0 | The delay time in milliseconds. | ||||||||||
options |
Object | The optional parameters.
Properties
|
- Source:
Returns:
- Type
- LerpToResult
Example
const box = new THING.Box();
THING.App.current.tween.lerpTo({ opacity: 1}, { opacity: 0.2}, 2000).onUpdate(ev => {
box.style.opacity = ev.value.opacity;
});