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

◆ update

detail::event::update_t update {}
inlineconstexpr

Event triggered whenever the tween position changes.

Fires after any step(), seek(), or jump() call. This is a convenience event that consolidates all position update events into a single callback point.

Common use cases:

  • Updating visuals regardless of how the tween changed
  • Monitoring all tween changes from one place
  • Logging every position update
  • Synchronizing with external systems
  • Implementing universal change handlers
Note
This event fires after the specific event (step, seek, or jump) and before the complete event if applicable.
auto tween = tweeny::from(0).to(100).during(60U).build();
printf("Tween updated to: %d\n", t.peek());
});
tween.step(10); // Triggers update
tween.seek(50U); // Triggers update
tween.jump(1); // Triggers update
auto step(int32_t frames) -> tween_value_t
Advances or rewinds the animation by a frame delta.
auto seek(uint32_t target_frame) -> tween_value_t
Seeks to a specific frame in the animation.
auto jump(std::size_t target_key_frame) -> tween_value_t
Jumps to a specific keyframe index.
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::update_t update
Event triggered whenever the tween position changes.
Definition event.h:280
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
step For frame-by-frame updates
seek For arbitrary frame jumps
jump For keyframe jumps