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

◆ keyframeEnter

detail::event::keyframeEnter_t keyframeEnter {}
inlineconstexpr

Event triggered when entering a new keyframe segment.

Fires when the tween transitions into a new keyframe section during playback. The callback receives both the tween reference and a keyframeEnter struct containing the keyframe index.

Common use cases:

  • Triggering phase-specific animations
  • Playing transition sounds
  • Updating UI to reflect animation phase
  • Synchronizing multi-part animations
  • Implementing animation state machines
Note
Keyframe indices are 0-based. The first keyframe is index 0, second is 1, etc.
.to(50).during(30U)
.to(100).during(30U)
.build();
printf("Entering keyframe %zu\n", evt.key_frame);
});
tween.step(31); // Triggers: "Entering keyframe 1"
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
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
Event data passed when entering a new keyframe.
Definition detail/event.h:81
See also
keyframeLeave For detecting when leaving a keyframe
keyframeEnter For the event data struct
jump For manually jumping to keyframes