|
TachyonUI 1.1.0
High-performance UI for building tools.
|
Tracks the running transitions of the elements' state channels. More...
#include <gui_controls/gui_transition_manager.h>
Public Member Functions | |
| void | OnStateChange (ID id, ElementState fromState, ElementState toState, float elapsedSecs) |
| The element's state went from fromState to toState: each channel that changed starts toward it, or turns around, in its timing. | |
| void | OnStateSeen (ID id, ElementState state, ElementState watched, float elapsedSecs) |
| For an element whose watched bits change between frames rather than with input (Selected for ElementFlags::AnimatesSelected, Invalid), each frame it's built: when one differs from the frame before, its channel runs, Selected in kToggle. | |
| bool | IsWatched (ID id) const |
| True when OnStateSeen saw the element the frame before or this one. | |
| std::optional< float > | Value (ID id, TransitionChannel channel, float elapsedSecs) const |
| How far on (0 to 1) the element's channel is while it runs; nothing when it doesn't. | |
| bool | IsRunning (ID id) const |
| True while one of the element's channels runs. | |
| bool | HasRunning () const |
| True while any element's channel runs. | |
| TransitionState | Resolve (ID id, VisualBoxStyleIndex base, ElementState currentState, float elapsedSecs) const |
| The element's box base in currentState: the styles of the states its running channels are between, each by how far they are (at most StyleBlend::kMaxStyles, the heaviest), or its current style alone. | |
| void | Purge (float elapsedSecs) |
| Once a frame, after the build: lets go of the channels that have ended, and of the elements without one; forgets what OnStateSeen saw of elements not built this frame. | |
| void | Clear () |
| Removes all active transitions, for instance after a reorder invalidates ID mappings. | |
| void | SetEnabled (bool enabled) |
| Test/debug seam: when disabled, states snap instantly (deterministic rendering). | |
| bool | IsEnabled () const |
| True unless SetEnabled(false) was called. | |
| void | SetReducedMotion (bool reduced) |
| Reduced motion: every change is instant. Turning it on drops the active transitions. | |
| bool | IsReducedMotion () const |
Static Public Member Functions | |
| static TransitionTiming | TimingFor (TransitionChannel channel, bool on) |
| The timing of channel turning on, or off. | |
Static Public Attributes | |
| static constexpr TransitionTiming | kHoverIn { 0.070f, Easing::EaseOut } |
| static constexpr TransitionTiming | kHoverOut { 0.140f, Easing::EaseOut } |
| static constexpr TransitionTiming | kRelease { 0.120f, Easing::EaseOut } |
| static constexpr TransitionTiming | kFocus { 0.100f, Easing::EaseOut } |
| static constexpr TransitionTiming | kToggle { 0.120f, Easing::EaseInOut } |
| a switch, check box or radio turning on or off | |
| static constexpr TransitionTiming | kInvalid { 0.150f, Easing::EaseOut } |
| the invalid halo growing in | |
Tracks the running transitions of the elements' state channels.
Each channel goes from off (0) to on (1) or back on its own timing; one that turns around mid-way carries on from where it is. Only elements with a channel running take a slot, in a compact array, and only they are looked at each frame. Times are seconds on the application's elapsed-time clock.
|
static |
The timing of channel turning on, or off.
Selected is instant here; a toggle's part (OnStateSeen) turns in kToggle.
| void tachyon::TransitionManager::OnStateChange | ( | ID | id, |
| ElementState | fromState, | ||
| ElementState | toState, | ||
| float | elapsedSecs ) |
The element's state went from fromState to toState: each channel that changed starts toward it, or turns around, in its timing.
Disabled changes at once.
| void tachyon::TransitionManager::OnStateSeen | ( | ID | id, |
| ElementState | state, | ||
| ElementState | watched, | ||
| float | elapsedSecs ) |
For an element whose watched bits change between frames rather than with input (Selected for ElementFlags::AnimatesSelected, Invalid), each frame it's built: when one differs from the frame before, its channel runs, Selected in kToggle.
An element that wasn't built the frame before starts without one.
|
inline |
True when OnStateSeen saw the element the frame before or this one.
| std::optional< float > tachyon::TransitionManager::Value | ( | ID | id, |
| TransitionChannel | channel, | ||
| float | elapsedSecs ) const |
How far on (0 to 1) the element's channel is while it runs; nothing when it doesn't.
|
inline |
True while one of the element's channels runs.
|
inline |
True while any element's channel runs.
| TransitionState tachyon::TransitionManager::Resolve | ( | ID | id, |
| VisualBoxStyleIndex | base, | ||
| ElementState | currentState, | ||
| float | elapsedSecs ) const |
The element's box base in currentState: the styles of the states its running channels are between, each by how far they are (at most StyleBlend::kMaxStyles, the heaviest), or its current style alone.
| void tachyon::TransitionManager::Purge | ( | float | elapsedSecs | ) |
Once a frame, after the build: lets go of the channels that have ended, and of the elements without one; forgets what OnStateSeen saw of elements not built this frame.
|
inline |
Removes all active transitions, for instance after a reorder invalidates ID mappings.
|
inline |
Test/debug seam: when disabled, states snap instantly (deterministic rendering).
Disabling drops the active transitions.
|
inline |
True unless SetEnabled(false) was called.
|
inline |
Reduced motion: every change is instant. Turning it on drops the active transitions.
|
inline |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
a switch, check box or radio turning on or off
|
staticconstexpr |
the invalid halo growing in