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

◆ peek() [2/2]

template<typename FirstValueType, typename... RemainingValueTypes>
auto peek ( uint32_t target_frame) const -> tween_value_t
nodiscard

Queries the interpolated value at any frame without changing state.

Previews what the value would be at the target frame without moving the tween. Useful for scrubbing, previewing, or inspecting the animation curve. Does not trigger events.

Parameters
target_frameFrame to query (clamped to valid range)
Returns
Interpolated value at the target frame
auto t = tweeny::from(0).to(100).during(100U).build();
auto midpoint = t.peek(50U); // Preview value at frame 50 (returns 50)
auto start = t.peek(0U); // Preview start value (returns 0)
// Tween still at frame 0, not moved
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
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