rmp::behavior::Tween
Moves one property of its object from from to to over seconds, along an Ease. With neither loop nor ping_pong it stops exactly on to and finished() turns true.
Added to an object with add<rmp::behavior::Tween>(); the framework calls its _update with the object it is on.
Fields
| Field | Type | Default | What it is |
|---|---|---|---|
property | Property | Property::POSITION_Y | The field it writes |
from | float | 0 | The value at the start of a pass, in that field's unit |
to | float | 0 | The value at the end of a pass |
seconds | float | 1 | How long one pass takes; 0 = straight to |
ease | Ease | Ease::IN_OUT | The curve of each pass |
loop | bool | false | Start again from |
ping_pong | bool | false | Turn back at each end, forever; wins over |
ours | struct { … } | What it is keeping track of. Readable, because sometimes you want it; not yours to write. It is one PUBLIC member and not a private block because a struct with a private member is not an aggregate in C++20, and then |
finished
Whether it has stopped on to: a tween with neither loop nor ping_pong does at the end of its pass, and one of 0 seconds at once, whatever those two say.
restart
Starts it again from from, going forwards, as if it had just been added.