Added signal for Tween emitted at completion
(cherry picked from commit a19e99aacb
)
This commit is contained in:
parent
ae6d45b0f2
commit
759c1fb0b8
|
@ -348,6 +348,11 @@
|
||||||
</member>
|
</member>
|
||||||
</members>
|
</members>
|
||||||
<signals>
|
<signals>
|
||||||
|
<signal name="tween_all_completed">
|
||||||
|
<description>
|
||||||
|
Emitted when all processes in a tween end.
|
||||||
|
</description>
|
||||||
|
</signal>
|
||||||
<signal name="tween_completed">
|
<signal name="tween_completed">
|
||||||
<argument index="0" name="object" type="Object">
|
<argument index="0" name="object" type="Object">
|
||||||
</argument>
|
</argument>
|
||||||
|
|
|
@ -223,6 +223,7 @@ void Tween::_bind_methods() {
|
||||||
ADD_SIGNAL(MethodInfo("tween_started", PropertyInfo(Variant::OBJECT, "object"), PropertyInfo(Variant::NODE_PATH, "key")));
|
ADD_SIGNAL(MethodInfo("tween_started", PropertyInfo(Variant::OBJECT, "object"), PropertyInfo(Variant::NODE_PATH, "key")));
|
||||||
ADD_SIGNAL(MethodInfo("tween_step", PropertyInfo(Variant::OBJECT, "object"), PropertyInfo(Variant::NODE_PATH, "key"), PropertyInfo(Variant::REAL, "elapsed"), PropertyInfo(Variant::OBJECT, "value")));
|
ADD_SIGNAL(MethodInfo("tween_step", PropertyInfo(Variant::OBJECT, "object"), PropertyInfo(Variant::NODE_PATH, "key"), PropertyInfo(Variant::REAL, "elapsed"), PropertyInfo(Variant::OBJECT, "value")));
|
||||||
ADD_SIGNAL(MethodInfo("tween_completed", PropertyInfo(Variant::OBJECT, "object"), PropertyInfo(Variant::NODE_PATH, "key")));
|
ADD_SIGNAL(MethodInfo("tween_completed", PropertyInfo(Variant::OBJECT, "object"), PropertyInfo(Variant::NODE_PATH, "key")));
|
||||||
|
ADD_SIGNAL(MethodInfo("tween_all_completed"));
|
||||||
|
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "repeat"), "set_repeat", "is_repeat");
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "repeat"), "set_repeat", "is_repeat");
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_tween_process_mode", "get_tween_process_mode");
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_tween_process_mode", "get_tween_process_mode");
|
||||||
|
@ -628,8 +629,10 @@ void Tween::_tween_process(float p_delta) {
|
||||||
}
|
}
|
||||||
pending_update--;
|
pending_update--;
|
||||||
|
|
||||||
if (all_finished)
|
if (all_finished) {
|
||||||
set_active(false);
|
set_active(false);
|
||||||
|
emit_signal("tween_all_completed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tween::set_tween_process_mode(TweenProcessMode p_mode) {
|
void Tween::set_tween_process_mode(TweenProcessMode p_mode) {
|
||||||
|
|
Loading…
Reference in New Issue