ZenitUI
Retained-mode C++20 UI framework
Loading...
Searching...
No Matches
ZenitUI::UIAnimation Class Reference

A time-parameterised sequence of per-property tracks. More...

#include <AnimPrimitives.hpp>

Classes

struct  TrackBase
 Type-erased track interface. More...
struct  Track
 Concrete typed track: start/end pair plus a setter. More...

Public Member Functions

 UIAnimation (float duration=1.0f, float delay=0.0f)
template<typename T, typename Callable>
void addTrack (T start, T end, Callable setter, TransitionFunction tr=TransitionFunction::Linear)
 Append a typed track.

Public Attributes

float duration
float delay {0.0f}
bool blocksInput {true}
std::vector< std::unique_ptr< TrackBase > > tracks
std::function< void()> onFinished

Detailed Description

A time-parameterised sequence of per-property tracks.

Each track pairs a start and end value with a setter callback that writes the interpolated value into the target Layout. The setter is type-erased behind TrackBase, so UIAnimation can hold tracks of different value types (e.g. float opacity and Value translateY).

Duration and delay are in seconds. blocksInput, if set, is reported back to Layout::update via AnimationPlayer::tickImperative and blocks input to the subtree for the animation's whole lifetime.


The documentation for this class was generated from the following file: