summaryrefslogtreecommitdiff
path: root/scene/animation
diff options
context:
space:
mode:
authorsteincodes <swarnimarun11@gmail.com>2018-06-07 16:55:24 +0530
committersteincodes <swarnimarun11@gmail.com>2018-06-07 17:14:31 +0530
commitd3483d8c1e7d454f477343472b1d1cae5d54106d (patch)
tree2de8e0afa39d2624cd6a4c9000ed6028b879a052 /scene/animation
parent25704427b56c5d11117d1d497554731f99ed94b7 (diff)
Adding is_stopped method to Tween
Diffstat (limited to 'scene/animation')
-rw-r--r--scene/animation/tween.cpp5
-rw-r--r--scene/animation/tween.h1
2 files changed, 6 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);
diff --git a/scene/animation/tween.h b/scene/animation/tween.h
index 757d80e90a..36094bf294 100644
--- a/scene/animation/tween.h
+++ b/scene/animation/tween.h
@@ -162,6 +162,7 @@ public:
bool reset_all();
bool stop(Object *p_object, StringName p_key);
bool stop_all();
+ bool is_stopped() const;
bool resume(Object *p_object, StringName p_key);
bool resume_all();
bool remove(Object *p_object, StringName p_key);