diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2018-06-07 17:49:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-07 17:49:06 +0200 |
commit | 3cd09cd9437ba7ad1755734beae3fd2c1e594566 (patch) | |
tree | 2036cb12d1d052072b790bc3ff2d086e63552077 /scene/animation/tween.cpp | |
parent | 0d7fa5f6eef41c4137a45d6e2f9650efd6ab9d00 (diff) | |
parent | d3483d8c1e7d454f477343472b1d1cae5d54106d (diff) |
Merge pull request #19410 from swarnimarun/tween-stopped
Adding is_stopped method to Tween
Diffstat (limited to 'scene/animation/tween.cpp')
-rw-r--r-- | scene/animation/tween.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 4eefcc9ced..9f7503577b 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -201,6 +201,7 @@ void Tween::_bind_methods() { ClassDB::bind_method(D_METHOD("reset_all"), &Tween::reset_all); ClassDB::bind_method(D_METHOD("stop", "object", "key"), &Tween::stop, DEFVAL("")); ClassDB::bind_method(D_METHOD("stop_all"), &Tween::stop_all); + ClassDB::bind_method(D_METHOD("is_stopped"), &Tween::is_stopped); ClassDB::bind_method(D_METHOD("resume", "object", "key"), &Tween::resume, DEFVAL("")); ClassDB::bind_method(D_METHOD("resume_all"), &Tween::resume_all); ClassDB::bind_method(D_METHOD("remove", "object", "key"), &Tween::remove, DEFVAL("")); @@ -743,6 +744,10 @@ bool Tween::stop(Object *p_object, StringName p_key) { return true; } +bool Tween::is_stopped() const { + return tell() >= get_runtime(); +} + bool Tween::stop_all() { set_active(false); |