summaryrefslogtreecommitdiff
path: root/scene/animation
diff options
context:
space:
mode:
Diffstat (limited to 'scene/animation')
-rw-r--r--scene/animation/animation_player.cpp18
-rw-r--r--scene/animation/animation_player.h4
-rw-r--r--scene/animation/animation_tree_player.cpp24
-rw-r--r--scene/animation/animation_tree_player.h6
-rw-r--r--scene/animation/tween.cpp108
-rw-r--r--scene/animation/tween.h22
6 files changed, 92 insertions, 90 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index fa0700584c..8b81c45597 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -36,7 +36,7 @@ bool AnimationPlayer::_set(const StringName& p_name, const Variant& p_value) {
String name=p_name;
if (p_name==SceneStringNames::get_singleton()->playback_speed || p_name==SceneStringNames::get_singleton()->speed) { //bw compatibility
- set_speed(p_value);
+ set_speed_scale(p_value);
} else if (p_name==SceneStringNames::get_singleton()->playback_active) {
set_active(p_value);
@@ -426,8 +426,10 @@ void AnimationPlayer::_animation_process_animation(AnimationData* p_anim,float p
Variant value=a->value_track_interpolate(i,p_time);
//thanks to trigger mode, this should be solved now..
- //if (p_delta==0 && value.get_type()==Variant::STRING)
- // continue; // doing this with strings is messy, should find another way
+ /*
+ if (p_delta==0 && value.get_type()==Variant::STRING)
+ continue; // doing this with strings is messy, should find another way
+ */
if (pa->accum_pass!=accum_pass) {
ERR_CONTINUE( cache_update_prop_size >= NODE_CACHE_UPDATE_MAX );
cache_update_prop[cache_update_prop_size++]=pa;
@@ -713,7 +715,7 @@ void AnimationPlayer::_animation_process(float p_delta) {
-// bool any_active=false;
+ //bool any_active=false;
if (playback.current.from) {
@@ -1082,13 +1084,13 @@ void AnimationPlayer::stop_all() {
}
-void AnimationPlayer::set_speed(float p_speed) {
+void AnimationPlayer::set_speed_scale(float p_speed) {
speed_scale=p_speed;
}
-float AnimationPlayer::get_speed() const {
+float AnimationPlayer::get_speed_scale() const {
return speed_scale;
}
@@ -1323,8 +1325,8 @@ void AnimationPlayer::_bind_methods() {
ClassDB::bind_method(_MD("set_active","active"),&AnimationPlayer::set_active);
ClassDB::bind_method(_MD("is_active"),&AnimationPlayer::is_active);
- ClassDB::bind_method(_MD("set_speed","speed"),&AnimationPlayer::set_speed);
- ClassDB::bind_method(_MD("get_speed"),&AnimationPlayer::get_speed);
+ ClassDB::bind_method(_MD("set_speed_scale","speed"),&AnimationPlayer::set_speed_scale);
+ ClassDB::bind_method(_MD("get_speed_scale"),&AnimationPlayer::get_speed_scale);
ClassDB::bind_method(_MD("set_autoplay","name"),&AnimationPlayer::set_autoplay);
ClassDB::bind_method(_MD("get_autoplay"),&AnimationPlayer::get_autoplay);
diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h
index 94955bec60..41bae6c928 100644
--- a/scene/animation/animation_player.h
+++ b/scene/animation/animation_player.h
@@ -271,8 +271,8 @@ public:
bool is_active() const;
bool is_valid() const;
- void set_speed(float p_speed);
- float get_speed() const;
+ void set_speed_scale(float p_speed);
+ float get_speed_scale() const;
void set_autoplay(const String& pname);
String get_autoplay() const;
diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp
index dbcdb284be..c3a05240bb 100644
--- a/scene/animation/animation_tree_player.cpp
+++ b/scene/animation/animation_tree_player.cpp
@@ -214,7 +214,7 @@ bool AnimationTreePlayer::_set(const StringName& p_name, const Variant& p_value)
StringName src = connections[i*3+0];
StringName dst = connections[i*3+1];
int dst_in = connections[i*3+2];
- connect(src,dst,dst_in);
+ connect_nodes(src,dst,dst_in);
}
set_active(data.get_valid("active"));
@@ -506,10 +506,10 @@ float AnimationTreePlayer::_process_node(const StringName& p_node,AnimationNode
float rem = 0;
if (!an->animation.is_null()) {
- // float pos = an->time;
-// float delta = p_time;
+ //float pos = an->time;
+ //float delta = p_time;
- // const Animation *a = an->animation.operator->();
+ //const Animation *a = an->animation.operator->();
if (p_seek) {
an->time=p_time;
@@ -1496,17 +1496,17 @@ AnimationTreePlayer::ConnectError AnimationTreePlayer::_cycle_test(const StringN
}
-Error AnimationTreePlayer::connect(const StringName& p_src_node,const StringName& p_dst_node, int p_dst_input) {
+Error AnimationTreePlayer::connect_nodes(const StringName& p_src_node,const StringName& p_dst_node, int p_dst_input) {
ERR_FAIL_COND_V( !node_map.has(p_src_node) , ERR_INVALID_PARAMETER);
ERR_FAIL_COND_V( !node_map.has(p_dst_node) , ERR_INVALID_PARAMETER);
ERR_FAIL_COND_V( p_src_node==p_dst_node , ERR_INVALID_PARAMETER);
-// NodeBase *src = node_map[p_src_node];
+ //NodeBase *src = node_map[p_src_node];
NodeBase *dst = node_map[p_dst_node];
ERR_FAIL_INDEX_V( p_dst_input, dst->inputs.size(), ERR_INVALID_PARAMETER);
-// int oldval = dst->inputs[p_dst_input].node;
+ //int oldval = dst->inputs[p_dst_input].node;
for(Map<StringName,NodeBase*>::Element *E=node_map.front();E;E=E->next()) {
@@ -1538,7 +1538,7 @@ Error AnimationTreePlayer::connect(const StringName& p_src_node,const StringName
return OK;
}
-bool AnimationTreePlayer::is_connected(const StringName& p_src_node,const StringName& p_dst_node, int p_dst_input) const {
+bool AnimationTreePlayer::are_nodes_connected(const StringName& p_src_node,const StringName& p_dst_node, int p_dst_input) const {
ERR_FAIL_COND_V( !node_map.has(p_src_node) , false);
ERR_FAIL_COND_V( !node_map.has(p_dst_node) , false);
@@ -1550,7 +1550,7 @@ bool AnimationTreePlayer::is_connected(const StringName& p_src_node,const String
}
-void AnimationTreePlayer::disconnect(const StringName& p_node, int p_input) {
+void AnimationTreePlayer::disconnect_nodes(const StringName& p_node, int p_input) {
ERR_FAIL_COND( !node_map.has(p_node));
@@ -1901,9 +1901,9 @@ void AnimationTreePlayer::_bind_methods() {
ClassDB::bind_method(_MD("node_get_pos","id"),&AnimationTreePlayer::node_get_pos);
ClassDB::bind_method(_MD("remove_node","id"),&AnimationTreePlayer::remove_node);
- ClassDB::bind_method(_MD("connect","id","dst_id","dst_input_idx"),&AnimationTreePlayer::connect);
- ClassDB::bind_method(_MD("is_connected","id","dst_id","dst_input_idx"),&AnimationTreePlayer::is_connected);
- ClassDB::bind_method(_MD("disconnect","id","dst_input_idx"),&AnimationTreePlayer::disconnect);
+ ClassDB::bind_method(_MD("connect_nodes","id","dst_id","dst_input_idx"),&AnimationTreePlayer::connect_nodes);
+ ClassDB::bind_method(_MD("are_nodes_connected","id","dst_id","dst_input_idx"),&AnimationTreePlayer::are_nodes_connected);
+ ClassDB::bind_method(_MD("disconnect_nodes","id","dst_input_idx"),&AnimationTreePlayer::disconnect_nodes);
ClassDB::bind_method(_MD("set_active","enabled"),&AnimationTreePlayer::set_active);
ClassDB::bind_method(_MD("is_active"),&AnimationTreePlayer::is_active);
diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h
index ae2fe8c2bb..5e118be034 100644
--- a/scene/animation/animation_tree_player.h
+++ b/scene/animation/animation_tree_player.h
@@ -397,9 +397,9 @@ public:
void get_node_list(List<StringName> *p_node_list) const;
void remove_node(const StringName& p_node);
- Error connect(const StringName& p_src_node,const StringName& p_dst_node, int p_dst_input);
- bool is_connected(const StringName& p_src_node,const StringName& p_dst_node, int p_input) const;
- void disconnect(const StringName& p_src_node, int p_input);
+ Error connect_nodes(const StringName& p_src_node,const StringName& p_dst_node, int p_dst_input);
+ bool are_nodes_connected(const StringName& p_src_node,const StringName& p_dst_node, int p_input) const;
+ void disconnect_nodes(const StringName& p_src_node, int p_input);
void set_base_path(const NodePath& p_path);
NodePath get_base_path() const;
diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp
index b2ae1fd3d5..0916119db3 100644
--- a/scene/animation/tween.cpp
+++ b/scene/animation/tween.cpp
@@ -109,7 +109,7 @@ bool Tween::_set(const StringName& p_name, const Variant& p_value) {
String name=p_name;
if (name=="playback/speed" || name=="speed") { //bw compatibility
- set_speed(p_value);
+ set_speed_scale(p_value);
} else if (name=="playback/active") {
set_active(p_value);
@@ -192,8 +192,8 @@ void Tween::_bind_methods() {
ClassDB::bind_method(_MD("is_repeat"),&Tween::is_repeat );
ClassDB::bind_method(_MD("set_repeat","repeat"),&Tween::set_repeat );
- ClassDB::bind_method(_MD("set_speed","speed"),&Tween::set_speed);
- ClassDB::bind_method(_MD("get_speed"),&Tween::get_speed);
+ ClassDB::bind_method(_MD("set_speed_scale","speed"),&Tween::set_speed_scale);
+ ClassDB::bind_method(_MD("get_speed_scale"),&Tween::get_speed_scale);
ClassDB::bind_method(_MD("set_tween_process_mode","mode"),&Tween::set_tween_process_mode);
ClassDB::bind_method(_MD("get_tween_process_mode"),&Tween::get_tween_process_mode);
@@ -212,14 +212,14 @@ void Tween::_bind_methods() {
ClassDB::bind_method(_MD("tell"),&Tween::tell );
ClassDB::bind_method(_MD("get_runtime"),&Tween::get_runtime );
- ClassDB::bind_method(_MD("interpolate_property","object","property","initial_val","final_val","times_in_sec","trans_type","ease_type","delay"),&Tween::interpolate_property, DEFVAL(0) );
- ClassDB::bind_method(_MD("interpolate_method","object","method","initial_val","final_val","times_in_sec","trans_type","ease_type","delay"),&Tween::interpolate_method, DEFVAL(0) );
- ClassDB::bind_method(_MD("interpolate_callback","object","times_in_sec","callback","arg1", "arg2","arg3","arg4","arg5"),&Tween::interpolate_callback, DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()) );
- ClassDB::bind_method(_MD("interpolate_deferred_callback","object","times_in_sec","callback","arg1","arg2","arg3","arg4","arg5"),&Tween::interpolate_deferred_callback, DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()) );
- ClassDB::bind_method(_MD("follow_property","object","property","initial_val","target","target_property","times_in_sec","trans_type","ease_type","delay"),&Tween::follow_property, DEFVAL(0) );
- ClassDB::bind_method(_MD("follow_method","object","method","initial_val","target","target_method","times_in_sec","trans_type","ease_type","delay"),&Tween::follow_method, DEFVAL(0) );
- ClassDB::bind_method(_MD("targeting_property","object","property","initial","initial_val","final_val","times_in_sec","trans_type","ease_type","delay"),&Tween::targeting_property, DEFVAL(0) );
- ClassDB::bind_method(_MD("targeting_method","object","method","initial","initial_method","final_val","times_in_sec","trans_type","ease_type","delay"),&Tween::targeting_method, DEFVAL(0) );
+ ClassDB::bind_method(_MD("interpolate_property","object","property","initial_val","final_val","duration","trans_type","ease_type","delay"),&Tween::interpolate_property, DEFVAL(0) );
+ ClassDB::bind_method(_MD("interpolate_method","object","method","initial_val","final_val","duration","trans_type","ease_type","delay"),&Tween::interpolate_method, DEFVAL(0) );
+ ClassDB::bind_method(_MD("interpolate_callback","object","duration","callback","arg1", "arg2","arg3","arg4","arg5"),&Tween::interpolate_callback, DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()) );
+ ClassDB::bind_method(_MD("interpolate_deferred_callback","object","duration","callback","arg1","arg2","arg3","arg4","arg5"),&Tween::interpolate_deferred_callback, DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()) );
+ ClassDB::bind_method(_MD("follow_property","object","property","initial_val","target","target_property","duration","trans_type","ease_type","delay"),&Tween::follow_property, DEFVAL(0) );
+ ClassDB::bind_method(_MD("follow_method","object","method","initial_val","target","target_method","duration","trans_type","ease_type","delay"),&Tween::follow_method, DEFVAL(0) );
+ ClassDB::bind_method(_MD("targeting_property","object","property","initial","initial_val","final_val","duration","trans_type","ease_type","delay"),&Tween::targeting_property, DEFVAL(0) );
+ ClassDB::bind_method(_MD("targeting_method","object","method","initial","initial_method","final_val","duration","trans_type","ease_type","delay"),&Tween::targeting_method, DEFVAL(0) );
ADD_SIGNAL( MethodInfo("tween_started", PropertyInfo( Variant::OBJECT,"object"), PropertyInfo( Variant::STRING,"key")) );
ADD_SIGNAL( MethodInfo("tween_step", PropertyInfo( Variant::OBJECT,"object"), PropertyInfo( Variant::STRING,"key"), PropertyInfo( Variant::REAL,"elapsed"), PropertyInfo( Variant::OBJECT,"value")) );
@@ -339,21 +339,21 @@ Variant Tween::_run_equation(InterpolateData& p_data) {
Variant result;
#define APPLY_EQUATION(element)\
- r.element = _run_equation(p_data.trans_type, p_data.ease_type, p_data.elapsed - p_data.delay, i.element, d.element, p_data.times_in_sec);
+ r.element = _run_equation(p_data.trans_type, p_data.ease_type, p_data.elapsed - p_data.delay, i.element, d.element, p_data.duration);
switch(initial_val.get_type())
{
case Variant::BOOL:
- result = ( _run_equation(p_data.trans_type, p_data.ease_type, p_data.elapsed - p_data.delay, initial_val, delta_val, p_data.times_in_sec)) >= 0.5;
+ result = ( _run_equation(p_data.trans_type, p_data.ease_type, p_data.elapsed - p_data.delay, initial_val, delta_val, p_data.duration)) >= 0.5;
break;
case Variant::INT:
- result = (int) _run_equation(p_data.trans_type, p_data.ease_type, p_data.elapsed - p_data.delay, (int) initial_val, (int) delta_val, p_data.times_in_sec);
+ result = (int) _run_equation(p_data.trans_type, p_data.ease_type, p_data.elapsed - p_data.delay, (int) initial_val, (int) delta_val, p_data.duration);
break;
case Variant::REAL:
- result = _run_equation(p_data.trans_type, p_data.ease_type, p_data.elapsed - p_data.delay, (real_t) initial_val, (real_t) delta_val, p_data.times_in_sec);
+ result = _run_equation(p_data.trans_type, p_data.ease_type, p_data.elapsed - p_data.delay, (real_t) initial_val, (real_t) delta_val, p_data.duration);
break;
case Variant::VECTOR2:
@@ -577,9 +577,9 @@ void Tween::_tween_process(float p_delta) {
_apply_tween_value(data, data.initial_val);
}
- if(data.elapsed > (data.delay + data.times_in_sec)) {
+ if(data.elapsed > (data.delay + data.duration)) {
- data.elapsed = data.delay + data.times_in_sec;
+ data.elapsed = data.delay + data.duration;
data.finish = true;
}
@@ -697,12 +697,12 @@ void Tween::set_repeat(bool p_repeat) {
repeat = p_repeat;
}
-void Tween::set_speed(float p_speed) {
+void Tween::set_speed_scale(float p_speed) {
speed_scale=p_speed;
}
-float Tween::get_speed() const {
+float Tween::get_speed_scale() const {
return speed_scale;
}
@@ -871,10 +871,10 @@ bool Tween::seek(real_t p_time) {
data.finish = false;
continue;
}
- else if(data.elapsed >= (data.delay + data.times_in_sec)) {
+ else if(data.elapsed >= (data.delay + data.duration)) {
data.finish = true;
- data.elapsed = (data.delay + data.times_in_sec);
+ data.elapsed = (data.delay + data.duration);
} else
data.finish = false;
@@ -916,7 +916,7 @@ real_t Tween::get_runtime() const {
for(const List<InterpolateData>::Element *E=interpolates.front();E;E=E->next()) {
const InterpolateData& data = E->get();
- real_t t = data.delay + data.times_in_sec;
+ real_t t = data.delay + data.duration;
if(t > runtime)
runtime = t;
}
@@ -1035,7 +1035,7 @@ bool Tween::interpolate_property(Object *p_object
, String p_property
, Variant p_initial_val
, Variant p_final_val
- , real_t p_times_in_sec
+ , real_t p_duration
, TransitionType p_trans_type
, EaseType p_ease_type
, real_t p_delay
@@ -1046,7 +1046,7 @@ bool Tween::interpolate_property(Object *p_object
, p_property
, p_initial_val
, p_final_val
- , p_times_in_sec
+ , p_duration
, p_trans_type
, p_ease_type
, p_delay
@@ -1060,7 +1060,7 @@ bool Tween::interpolate_property(Object *p_object
ERR_FAIL_COND_V(p_object == NULL, false);
ERR_FAIL_COND_V(!ObjectDB::instance_validate(p_object), false);
ERR_FAIL_COND_V(p_initial_val.get_type() != p_final_val.get_type(), false);
- ERR_FAIL_COND_V(p_times_in_sec <= 0, false);
+ ERR_FAIL_COND_V(p_duration <= 0, false);
ERR_FAIL_COND_V(p_trans_type < 0 || p_trans_type >= TRANS_COUNT, false);
ERR_FAIL_COND_V(p_ease_type < 0 || p_ease_type >= EASE_COUNT, false);
ERR_FAIL_COND_V(p_delay < 0, false);
@@ -1079,7 +1079,7 @@ bool Tween::interpolate_property(Object *p_object
data.key = p_property;
data.initial_val = p_initial_val;
data.final_val = p_final_val;
- data.times_in_sec = p_times_in_sec;
+ data.duration = p_duration;
data.trans_type = p_trans_type;
data.ease_type = p_ease_type;
data.delay = p_delay;
@@ -1095,7 +1095,7 @@ bool Tween::interpolate_method(Object *p_object
, String p_method
, Variant p_initial_val
, Variant p_final_val
- , real_t p_times_in_sec
+ , real_t p_duration
, TransitionType p_trans_type
, EaseType p_ease_type
, real_t p_delay
@@ -1106,7 +1106,7 @@ bool Tween::interpolate_method(Object *p_object
, p_method
, p_initial_val
, p_final_val
- , p_times_in_sec
+ , p_duration
, p_trans_type
, p_ease_type
, p_delay
@@ -1120,7 +1120,7 @@ bool Tween::interpolate_method(Object *p_object
ERR_FAIL_COND_V(p_object == NULL, false);
ERR_FAIL_COND_V(!ObjectDB::instance_validate(p_object), false);
ERR_FAIL_COND_V(p_initial_val.get_type() != p_final_val.get_type(), false);
- ERR_FAIL_COND_V(p_times_in_sec <= 0, false);
+ ERR_FAIL_COND_V(p_duration <= 0, false);
ERR_FAIL_COND_V(p_trans_type < 0 || p_trans_type >= TRANS_COUNT, false);
ERR_FAIL_COND_V(p_ease_type < 0 || p_ease_type >= EASE_COUNT, false);
ERR_FAIL_COND_V(p_delay < 0, false);
@@ -1138,7 +1138,7 @@ bool Tween::interpolate_method(Object *p_object
data.key = p_method;
data.initial_val = p_initial_val;
data.final_val = p_final_val;
- data.times_in_sec = p_times_in_sec;
+ data.duration = p_duration;
data.trans_type = p_trans_type;
data.ease_type = p_ease_type;
data.delay = p_delay;
@@ -1151,7 +1151,7 @@ bool Tween::interpolate_method(Object *p_object
}
bool Tween::interpolate_callback(Object *p_object
- , real_t p_times_in_sec
+ , real_t p_duration
, String p_callback
, VARIANT_ARG_DECLARE
) {
@@ -1159,7 +1159,7 @@ bool Tween::interpolate_callback(Object *p_object
if(pending_update != 0) {
_add_pending_command("interpolate_callback"
, p_object
- , p_times_in_sec
+ , p_duration
, p_callback
, p_arg1
, p_arg2
@@ -1172,7 +1172,7 @@ bool Tween::interpolate_callback(Object *p_object
ERR_FAIL_COND_V(p_object == NULL, false);
ERR_FAIL_COND_V(!ObjectDB::instance_validate(p_object), false);
- ERR_FAIL_COND_V(p_times_in_sec < 0, false);
+ ERR_FAIL_COND_V(p_duration < 0, false);
ERR_EXPLAIN("Object has no callback named: %s" + p_callback);
ERR_FAIL_COND_V(!p_object->has_method(p_callback), false);
@@ -1186,7 +1186,7 @@ bool Tween::interpolate_callback(Object *p_object
data.id = p_object->get_instance_ID();
data.key = p_callback;
- data.times_in_sec = p_times_in_sec;
+ data.duration = p_duration;
data.delay = 0;
int args=0;
@@ -1217,7 +1217,7 @@ bool Tween::interpolate_callback(Object *p_object
}
bool Tween::interpolate_deferred_callback(Object *p_object
- , real_t p_times_in_sec
+ , real_t p_duration
, String p_callback
, VARIANT_ARG_DECLARE
) {
@@ -1225,7 +1225,7 @@ bool Tween::interpolate_deferred_callback(Object *p_object
if(pending_update != 0) {
_add_pending_command("interpolate_deferred_callback"
, p_object
- , p_times_in_sec
+ , p_duration
, p_callback
, p_arg1
, p_arg2
@@ -1237,7 +1237,7 @@ bool Tween::interpolate_deferred_callback(Object *p_object
}
ERR_FAIL_COND_V(p_object == NULL, false);
ERR_FAIL_COND_V(!ObjectDB::instance_validate(p_object), false);
- ERR_FAIL_COND_V(p_times_in_sec < 0, false);
+ ERR_FAIL_COND_V(p_duration < 0, false);
ERR_EXPLAIN("Object has no callback named: %s" + p_callback);
ERR_FAIL_COND_V(!p_object->has_method(p_callback), false);
@@ -1251,7 +1251,7 @@ bool Tween::interpolate_deferred_callback(Object *p_object
data.id = p_object->get_instance_ID();
data.key = p_callback;
- data.times_in_sec = p_times_in_sec;
+ data.duration = p_duration;
data.delay = 0;
int args=0;
@@ -1286,7 +1286,7 @@ bool Tween::follow_property(Object *p_object
, Variant p_initial_val
, Object *p_target
, String p_target_property
- , real_t p_times_in_sec
+ , real_t p_duration
, TransitionType p_trans_type
, EaseType p_ease_type
, real_t p_delay
@@ -1298,7 +1298,7 @@ bool Tween::follow_property(Object *p_object
, p_initial_val
, p_target
, p_target_property
- , p_times_in_sec
+ , p_duration
, p_trans_type
, p_ease_type
, p_delay
@@ -1312,7 +1312,7 @@ bool Tween::follow_property(Object *p_object
ERR_FAIL_COND_V(!ObjectDB::instance_validate(p_object), false);
ERR_FAIL_COND_V(p_target == NULL, false);
ERR_FAIL_COND_V(!ObjectDB::instance_validate(p_target), false);
- ERR_FAIL_COND_V(p_times_in_sec <= 0, false);
+ ERR_FAIL_COND_V(p_duration <= 0, false);
ERR_FAIL_COND_V(p_trans_type < 0 || p_trans_type >= TRANS_COUNT, false);
ERR_FAIL_COND_V(p_ease_type < 0 || p_ease_type >= EASE_COUNT, false);
ERR_FAIL_COND_V(p_delay < 0, false);
@@ -1340,7 +1340,7 @@ bool Tween::follow_property(Object *p_object
data.initial_val = p_initial_val;
data.target_id = p_target->get_instance_ID();
data.target_key = p_target_property;
- data.times_in_sec = p_times_in_sec;
+ data.duration = p_duration;
data.trans_type = p_trans_type;
data.ease_type = p_ease_type;
data.delay = p_delay;
@@ -1354,7 +1354,7 @@ bool Tween::follow_method(Object *p_object
, Variant p_initial_val
, Object *p_target
, String p_target_method
- , real_t p_times_in_sec
+ , real_t p_duration
, TransitionType p_trans_type
, EaseType p_ease_type
, real_t p_delay
@@ -1366,7 +1366,7 @@ bool Tween::follow_method(Object *p_object
, p_initial_val
, p_target
, p_target_method
- , p_times_in_sec
+ , p_duration
, p_trans_type
, p_ease_type
, p_delay
@@ -1380,7 +1380,7 @@ bool Tween::follow_method(Object *p_object
ERR_FAIL_COND_V(!ObjectDB::instance_validate(p_object), false);
ERR_FAIL_COND_V(p_target == NULL, false);
ERR_FAIL_COND_V(!ObjectDB::instance_validate(p_target), false);
- ERR_FAIL_COND_V(p_times_in_sec <= 0, false);
+ ERR_FAIL_COND_V(p_duration <= 0, false);
ERR_FAIL_COND_V(p_trans_type < 0 || p_trans_type >= TRANS_COUNT, false);
ERR_FAIL_COND_V(p_ease_type < 0 || p_ease_type >= EASE_COUNT, false);
ERR_FAIL_COND_V(p_delay < 0, false);
@@ -1409,7 +1409,7 @@ bool Tween::follow_method(Object *p_object
data.initial_val = p_initial_val;
data.target_id = p_target->get_instance_ID();
data.target_key = p_target_method;
- data.times_in_sec = p_times_in_sec;
+ data.duration = p_duration;
data.trans_type = p_trans_type;
data.ease_type = p_ease_type;
data.delay = p_delay;
@@ -1423,7 +1423,7 @@ bool Tween::targeting_property(Object *p_object
, Object *p_initial
, String p_initial_property
, Variant p_final_val
- , real_t p_times_in_sec
+ , real_t p_duration
, TransitionType p_trans_type
, EaseType p_ease_type
, real_t p_delay
@@ -1435,7 +1435,7 @@ bool Tween::targeting_property(Object *p_object
, p_initial
, p_initial_property
, p_final_val
- , p_times_in_sec
+ , p_duration
, p_trans_type
, p_ease_type
, p_delay
@@ -1449,7 +1449,7 @@ bool Tween::targeting_property(Object *p_object
ERR_FAIL_COND_V(!ObjectDB::instance_validate(p_object), false);
ERR_FAIL_COND_V(p_initial == NULL, false);
ERR_FAIL_COND_V(!ObjectDB::instance_validate(p_initial), false);
- ERR_FAIL_COND_V(p_times_in_sec <= 0, false);
+ ERR_FAIL_COND_V(p_duration <= 0, false);
ERR_FAIL_COND_V(p_trans_type < 0 || p_trans_type >= TRANS_COUNT, false);
ERR_FAIL_COND_V(p_ease_type < 0 || p_ease_type >= EASE_COUNT, false);
ERR_FAIL_COND_V(p_delay < 0, false);
@@ -1478,7 +1478,7 @@ bool Tween::targeting_property(Object *p_object
data.target_key = p_initial_property;
data.initial_val = initial_val;
data.final_val = p_final_val;
- data.times_in_sec = p_times_in_sec;
+ data.duration = p_duration;
data.trans_type = p_trans_type;
data.ease_type = p_ease_type;
data.delay = p_delay;
@@ -1496,7 +1496,7 @@ bool Tween::targeting_method(Object *p_object
, Object *p_initial
, String p_initial_method
, Variant p_final_val
- , real_t p_times_in_sec
+ , real_t p_duration
, TransitionType p_trans_type
, EaseType p_ease_type
, real_t p_delay
@@ -1508,7 +1508,7 @@ bool Tween::targeting_method(Object *p_object
, p_initial
, p_initial_method
, p_final_val
- , p_times_in_sec
+ , p_duration
, p_trans_type
, p_ease_type
, p_delay
@@ -1522,7 +1522,7 @@ bool Tween::targeting_method(Object *p_object
ERR_FAIL_COND_V(!ObjectDB::instance_validate(p_object), false);
ERR_FAIL_COND_V(p_initial == NULL, false);
ERR_FAIL_COND_V(!ObjectDB::instance_validate(p_initial), false);
- ERR_FAIL_COND_V(p_times_in_sec <= 0, false);
+ ERR_FAIL_COND_V(p_duration <= 0, false);
ERR_FAIL_COND_V(p_trans_type < 0 || p_trans_type >= TRANS_COUNT, false);
ERR_FAIL_COND_V(p_ease_type < 0 || p_ease_type >= EASE_COUNT, false);
ERR_FAIL_COND_V(p_delay < 0, false);
@@ -1552,7 +1552,7 @@ bool Tween::targeting_method(Object *p_object
data.target_key = p_initial_method;
data.initial_val = initial_val;
data.final_val = p_final_val;
- data.times_in_sec = p_times_in_sec;
+ data.duration = p_duration;
data.trans_type = p_trans_type;
data.ease_type = p_ease_type;
data.delay = p_delay;
diff --git a/scene/animation/tween.h b/scene/animation/tween.h
index 01c5b5680e..07c2e90da2 100644
--- a/scene/animation/tween.h
+++ b/scene/animation/tween.h
@@ -92,7 +92,7 @@ private:
Variant final_val;
ObjectID target_id;
StringName target_key;
- real_t times_in_sec;
+ real_t duration;
TransitionType trans_type;
EaseType ease_type;
real_t delay;
@@ -165,8 +165,8 @@ public:
void set_tween_process_mode(TweenProcessMode p_mode);
TweenProcessMode get_tween_process_mode() const;
- void set_speed(float p_speed);
- float get_speed() const;
+ void set_speed_scale(float p_speed);
+ float get_speed_scale() const;
bool start();
bool reset(Object *p_node, String p_key);
@@ -186,7 +186,7 @@ public:
, String p_property
, Variant p_initial_val
, Variant p_final_val
- , real_t p_times_in_sec
+ , real_t p_duration
, TransitionType p_trans_type
, EaseType p_ease_type
, real_t p_delay = 0
@@ -196,20 +196,20 @@ public:
, String p_method
, Variant p_initial_val
, Variant p_final_val
- , real_t p_times_in_sec
+ , real_t p_duration
, TransitionType p_trans_type
, EaseType p_ease_type
, real_t p_delay = 0
);
bool interpolate_callback(Object *p_object
- , real_t p_times_in_sec
+ , real_t p_duration
, String p_callback
, VARIANT_ARG_DECLARE
);
bool interpolate_deferred_callback(Object *p_object
- , real_t p_times_in_sec
+ , real_t p_duration
, String p_callback
, VARIANT_ARG_DECLARE
);
@@ -219,7 +219,7 @@ public:
, Variant p_initial_val
, Object *p_target
, String p_target_property
- , real_t p_times_in_sec
+ , real_t p_duration
, TransitionType p_trans_type
, EaseType p_ease_type
, real_t p_delay = 0
@@ -230,7 +230,7 @@ public:
, Variant p_initial_val
, Object *p_target
, String p_target_method
- , real_t p_times_in_sec
+ , real_t p_duration
, TransitionType p_trans_type
, EaseType p_ease_type
, real_t p_delay = 0
@@ -241,7 +241,7 @@ public:
, Object *p_initial
, String p_initial_property
, Variant p_final_val
- , real_t p_times_in_sec
+ , real_t p_duration
, TransitionType p_trans_type
, EaseType p_ease_type
, real_t p_delay = 0
@@ -252,7 +252,7 @@ public:
, Object *p_initial
, String p_initial_method
, Variant p_final_val
- , real_t p_times_in_sec
+ , real_t p_duration
, TransitionType p_trans_type
, EaseType p_ease_type
, real_t p_delay = 0