Tweeny 4.1.0
A Tweening library for modern C++
Loading...
Searching...
No Matches

◆ step

detail::event::step_t step {}
inlineconstexpr

Event triggered after each step() call.

Use this event to react to frame-by-frame progression of an animation. The callback receives a reference to the tween and can query its current state using peek() or progress().

Common use cases:

  • Updating visual properties every frame
  • Logging animation progress
  • Synchronizing with other animations
  • Implementing custom timing logic
auto tween = tweeny::from(0).to(100).during(60U).build();
printf("Current value: %d\n", t.peek());
});
tween.step(1); // Triggers the callback
auto step(int32_t frames) -> tween_value_t
Advances or rewinds the animation by a frame delta.
auto on(detail::event::step_t, Callback &&cb) -> void
Registers a callback for step() events.
A tween represents an animation between keyframes.
Definition tween.h:68
tweeny_builder< true, FirstValue, RemainingValues... > to(const FirstValue &firstComponent, const RemainingValues &... remainingComponents) &
Adds a target keyframe to the tween.
Definition tweeny.h:109
tweeny_builder & during(FrameCountsType... frame_counts)
Specifies per-component frame durations for the last keyframe segment.
Definition tweeny.h:245
@ ok
Continue receiving events.
Definition detail/event.h:108
constexpr detail::event::step_t step
Event triggered after each step() call.
Definition event.h:83
tweeny_builder< false, FirstValue, RemainingValues... > from(FirstValue firstComponent, RemainingValues... remainingComponents)
Creates a new tween builder starting from the specified value(s).
Definition tweeny.h:347
See also
seek For events when jumping to specific frames
complete For events when animation finishes