summaryrefslogtreecommitdiffstats
path: root/scene/animation/tween.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-04-27 13:20:11 +0200
committerGitHub <noreply@github.com>2022-04-27 13:20:11 +0200
commit1de51133c9bf200eb7ba3f76fbf08ffe2e10d04d (patch)
treea0fb732d871c5d785f9cfbb43079976b5819c9b3 /scene/animation/tween.cpp
parentf626e8ef91d9f0c97c29ca04f2b240c4eae5214e (diff)
parent3017530e263891145eb6bbaf009d485510c95c8f (diff)
downloadredot-engine-1de51133c9bf200eb7ba3f76fbf08ffe2e10d04d.tar.gz
Merge pull request #60331 from KoBeWi/tween_static()
Diffstat (limited to 'scene/animation/tween.cpp')
-rw-r--r--scene/animation/tween.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp
index ccc878a6ec..97229ea89b 100644
--- a/scene/animation/tween.cpp
+++ b/scene/animation/tween.cpp
@@ -152,10 +152,6 @@ bool Tween::is_running() {
return running;
}
-void Tween::set_valid(bool p_valid) {
- valid = p_valid;
-}
-
bool Tween::is_valid() {
return valid;
}
@@ -648,7 +644,7 @@ void Tween::_bind_methods() {
ClassDB::bind_method(D_METHOD("parallel"), &Tween::parallel);
ClassDB::bind_method(D_METHOD("chain"), &Tween::chain);
- ClassDB::bind_method(D_METHOD("interpolate_value", "initial_value", "delta_value", "elapsed_time", "duration", "trans_type", "ease_type"), &Tween::interpolate_variant);
+ ClassDB::bind_static_method("Tween", D_METHOD("interpolate_value", "initial_value", "delta_value", "elapsed_time", "duration", "trans_type", "ease_type"), &Tween::interpolate_variant);
ADD_SIGNAL(MethodInfo("step_finished", PropertyInfo(Variant::INT, "idx")));
ADD_SIGNAL(MethodInfo("loop_finished", PropertyInfo(Variant::INT, "loop_count")));
@@ -679,6 +675,14 @@ void Tween::_bind_methods() {
BIND_ENUM_CONSTANT(EASE_OUT_IN);
}
+Tween::Tween() {
+ ERR_FAIL_MSG("Tween can't be created directly. Use create_tween() method.");
+}
+
+Tween::Tween(bool p_valid) {
+ valid = p_valid;
+}
+
Ref<PropertyTweener> PropertyTweener::from(Variant p_value) {
initial_val = p_value;
do_continue = false;