Provides a ramping / tweening mechanism that allows smooth transitions between two values.
More...
|
| | Ramp (Engine &engine=Engine::primary()) |
| | Constructor.
|
| |
| | Ramp (float duration, Engine &engine=Engine::primary()) |
| | Constructor with duration.
|
| |
| virtual float | get () |
| | Returns value of ramp.
|
| |
| virtual float | put (float value) |
| | Forces value in the ramp.
|
| |
| virtual float | mapTo (float toLow, float toHigh) |
| | Maps value to new range.
|
| |
| void | easing (easing_function easing) |
| | Sets easing function to apply to ramp.
|
| |
|
void | noEasing () |
| | Remove easing function (linear/no easing).
|
| |
| virtual void | to (float to) |
| | Assign final value of the ramp starting from current value.
|
| |
| virtual void | from (float from) |
| | Assign initial value of the ramp.
|
| |
| virtual void | fromTo (float from, float to) |
| | Assign initial and final values of the ramp.
|
| |
| virtual void | duration (float duration) |
| | Sets the duration of the chronometer.
|
| |
| virtual float | duration () const |
| | Returns duration.
|
| |
|
virtual void | speed (float speed) |
| | Sets the speed (rate of change) of the ramp in change-per-second.
|
| |
|
virtual float | speed () const |
| | Returns speed (rate of change) of the ramp in change-per-second.
|
| |
| virtual void | start () |
| | Starts/restarts the ramp. Will repeat the last ramp.
|
| |
| virtual void | go (float from, float to, float durationOrSpeed, easing_function easing=0) |
| | Starts a new ramp.
|
| |
| virtual void | go (float to, float durationOrSpeed, easing_function easing=0) |
| | Starts a new ramp, starting from current value.
|
| |
| virtual void | go (float to, easing_function easing=0) |
| | Starts a new ramp, starting from current value (keeping the same duration/speed).
|
| |
|
virtual void | mode (uint8_t mode) |
| | Changes the mode of the component (RAMP_DURATION or RAMP_SPEED).
|
| |
|
uint8_t | mode () const |
| | Returns the mode of the component (RAMP_DURATION or RAMP_SPEED).
|
| |
|
virtual bool | finished () |
| | Returns true iff the ramp just finished its process this step.
|
| |
|
virtual void | onFinish (EventCallback callback) |
| | Registers event callback on finish event.
|
| |
| virtual void | setTime (float time) |
| | Forces current time (in seconds).
|
| |
|
float | durationToSpeed (float duration) const |
| | Returns speed based on duration.
|
| |
|
float | speedToDuration (float speed) const |
| | Returns duration based on speed.
|
| |
| virtual void | start (float to, float durationOrSpeed, easing_function easing=0) |
| |
| virtual void | start (float from, float to, float durationOrSpeed, easing_function easing=0) |
| |
|
virtual void | clearEvents () |
| |
|
float | seconds () const |
| | Returns engine time in seconds.
|
| |
|
uint32_t | milliSeconds () const |
| | Returns engine time in milliseconds.
|
| |
|
uint64_t | microSeconds () const |
| | Returns engine time in microseconds.
|
| |
|
unsigned long | nSteps () const |
| | Returns number of engine steps.
|
| |
|
float | sampleRate () const |
| | Returns engine sample rate.
|
| |
|
float | samplePeriod () const |
| | Returns enginesample period.
|
| |
|
| operator float () |
| | Object can be used directly to access its value.
|
| |
|
| operator bool () |
| | Operator that allows usage in conditional expressions.
|
| |
|
virtual void | start (float duration) |
| | Starts/restarts the chronometer with specific duration.
|
| |
|
virtual float | progress () const |
| | The progress of the timer process (in %).
|
| |
|
virtual bool | isFinished () const |
| | Returns true iff the chronometer has finished its process.
|
| |
| virtual bool | isComplete () const |
| |
| virtual void | pause () |
| | Interrupts the chronometer.
|
| |
| virtual void | resume () |
| | Resumes process.
|
| |
|
virtual float | elapsed () const |
| | The time currently elapsed by the chronometer (in seconds).
|
| |
|
virtual bool | hasPassed (float timeout) const |
| | Returns true iff elapsed time has passed given timeout.
|
| |
| virtual bool | hasPassed (float timeout, bool restartIfPassed) |
| |
| virtual void | addTime (float time) |
| | Adds/subtracts time to the chronometer.
|
| |
| virtual bool | isRunning () const |
| | Returns true iff the chronometer is currently running.
|
| |
| bool | isStarted () const |
| |
|
virtual void | stop () |
| | Interrupts the chronometer and resets to zero.
|
| |
|
virtual void | togglePause () |
| | Toggles pause/unpause.
|
| |
Provides a ramping / tweening mechanism that allows smooth transitions between two values.