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

◆ on() [4/7]

template<typename FirstValueType, typename... RemainingValueTypes>
template<typename Callback>
auto on ( detail::event::keyframeLeave_t ,
Callback && cb ) -> void

Registers a callback for leaving a keyframe.

The callback is invoked when the tween transitions out of a keyframe section. Receives the tween reference and event data containing the keyframe index.

Parameters
cbCallback with signature: event::response(tween&, event::keyframeLeave)
auto t = tweeny::from(0).to(50).during(30U).to(100).during(30U).build();
t.on(event::keyframeLeave, [](auto& tween, auto evt) {
printf("Left keyframe %zu\n", evt.key_frame);
});
t.step(31); // Triggers: "Left keyframe 0"
tween(const key_frames_t &key_frames_input)
Constructs a tween from keyframes (use builder API instead).
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 leaving a keyframe.
Definition detail/event.h:92