Bind AudioStreamInteractive TRANSITION_TO_TIME_PREVIOUS_POSITION

In C++, enum AudioStreamInteractive::TransitionToTime has three "real"
members, plus MAX. Previously only TRANSITION_TO_TIME_SAME_POSITION and
TRANSITION_TO_TIME_START were bound for GDScript. But
TRANSITION_TO_TIME_PREVIOUS_POSITION can be set via the editor, so can
easily appear in an AudioStreamInteractive resource without needing to
drop down to C++. I can't see anything to suggest that it was
deliberately not exposed.

Bind this enum member. Add documentation.

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
This commit is contained in:
Will ThompsonandA Thousand Ships committed 2026-04-28 21:14:35 +01:00
1 parent 320e818469
commit 96eaa49fbb
2 files changed
+4

No files matched your search

@@ -522,6 +522,7 @@ void AudioStreamInteractive::_bind_methods() {
BIND_ENUM_CONSTANT(TRANSITION_TO_TIME_SAME_POSITION);
BIND_ENUM_CONSTANT(TRANSITION_TO_TIME_START);
BIND_ENUM_CONSTANT(TRANSITION_TO_TIME_PREVIOUS_POSITION);
BIND_ENUM_CONSTANT(FADE_DISABLED);
BIND_ENUM_CONSTANT(FADE_IN);
@@ -199,6 +199,9 @@
<constant name="TRANSITION_TO_TIME_START" value="1" enum="TransitionToTime">
Transition to the start of the destination clip.
</constant>
<constant name="TRANSITION_TO_TIME_PREVIOUS_POSITION" value="2" enum="TransitionToTime">
Transition to the last played position in the destination clip, if there was a previous transition from that clip. Otherwise, plays from the start of the destination clip.
</constant>
<constant name="FADE_DISABLED" value="0" enum="FadeMode">
Do not use fade for the transition. This is useful when transitioning from a clip-end to clip-beginning, and each clip has their begin/end.
</constant>