diff options
author | letheed <letheed@outlook.com> | 2017-09-10 15:37:49 +0200 |
---|---|---|
committer | letheed <letheed@outlook.com> | 2017-09-20 13:11:10 +0200 |
commit | 5ad9be4c24e9d7dc5672fdc42cea896622fe5685 (patch) | |
tree | a8811a50265edd940b00e12b9bd522e3e9b4694e /scene/animation | |
parent | ecd226c6a751f8a20766363fd1f2e1e0e2da8fba (diff) |
Rename pos to position in user facing methods and variables
Rename user facing methods and variables as well as the corresponding
C++ methods according to the folloming changes:
* pos -> position
* rot -> rotation
* loc -> location
C++ variables are left as is.
Diffstat (limited to 'scene/animation')
-rw-r--r-- | scene/animation/animation_player.cpp | 8 | ||||
-rw-r--r-- | scene/animation/animation_player.h | 2 | ||||
-rw-r--r-- | scene/animation/animation_tree_player.cpp | 16 | ||||
-rw-r--r-- | scene/animation/animation_tree_player.h | 4 |
4 files changed, 15 insertions, 15 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index be0b652276..cadbd086bc 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1045,7 +1045,7 @@ bool AnimationPlayer::is_valid() const { return (playback.current.from); } -float AnimationPlayer::get_current_animation_pos() const { +float AnimationPlayer::get_current_animation_position() const { ERR_FAIL_COND_V(!playback.current.from, 0); return playback.current.pos; @@ -1238,8 +1238,8 @@ void AnimationPlayer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_root", "path"), &AnimationPlayer::set_root); ClassDB::bind_method(D_METHOD("get_root"), &AnimationPlayer::get_root); - ClassDB::bind_method(D_METHOD("seek", "pos_sec", "update"), &AnimationPlayer::seek, DEFVAL(false)); - ClassDB::bind_method(D_METHOD("get_pos"), &AnimationPlayer::get_current_animation_pos); + ClassDB::bind_method(D_METHOD("seek", "seconds", "update"), &AnimationPlayer::seek, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_position"), &AnimationPlayer::get_current_animation_position); ClassDB::bind_method(D_METHOD("find_animation", "animation"), &AnimationPlayer::find_animation); @@ -1248,7 +1248,7 @@ void AnimationPlayer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_animation_process_mode", "mode"), &AnimationPlayer::set_animation_process_mode); ClassDB::bind_method(D_METHOD("get_animation_process_mode"), &AnimationPlayer::get_animation_process_mode); - ClassDB::bind_method(D_METHOD("get_current_animation_pos"), &AnimationPlayer::get_current_animation_pos); + ClassDB::bind_method(D_METHOD("get_current_animation_position"), &AnimationPlayer::get_current_animation_position); ClassDB::bind_method(D_METHOD("get_current_animation_length"), &AnimationPlayer::get_current_animation_length); ClassDB::bind_method(D_METHOD("advance", "delta"), &AnimationPlayer::advance); diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index c6e52145a8..bface7aabb 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -279,7 +279,7 @@ public: void seek(float p_time, bool p_update = false); void seek_delta(float p_time, float p_delta); - float get_current_animation_pos() const; + float get_current_animation_position() const; float get_current_animation_length() const; void advance(float p_time); diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index 38d0527288..a2a8adb653 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -92,7 +92,7 @@ bool AnimationTreePlayer::_set(const StringName &p_name, const Variant &p_value) Dictionary node = nodes[i]; StringName id = node.get_valid("id"); - Point2 pos = node.get_valid("pos"); + Point2 pos = node.get_valid("position"); NodeType nt = NODE_MAX; String type = node.get_valid("type"); @@ -122,7 +122,7 @@ bool AnimationTreePlayer::_set(const StringName &p_name, const Variant &p_value) if (nt != NODE_OUTPUT) add_node(nt, id); - node_set_pos(id, pos); + node_set_position(id, pos); switch (nt) { case NODE_OUTPUT: { @@ -245,7 +245,7 @@ bool AnimationTreePlayer::_get(const StringName &p_name, Variant &r_ret) const { Dictionary node; node["id"] = E->key(); - node["pos"] = n->pos; + node["position"] = n->pos; switch (n->type) { case NODE_OUTPUT: node["type"] = "output"; break; @@ -1176,7 +1176,7 @@ void AnimationTreePlayer::transition_node_set_current(const StringName &p_node, n->set_current(p_current); } -void AnimationTreePlayer::node_set_pos(const StringName &p_node, const Vector2 &p_pos) { +void AnimationTreePlayer::node_set_position(const StringName &p_node, const Vector2 &p_pos) { ERR_FAIL_COND(!node_map.has(p_node)); node_map[p_node]->pos = p_pos; @@ -1187,7 +1187,7 @@ AnimationTreePlayer::NodeType AnimationTreePlayer::node_get_type(const StringNam ERR_FAIL_COND_V(!node_map.has(p_node), NODE_OUTPUT); return node_map[p_node]->type; } -Point2 AnimationTreePlayer::node_get_pos(const StringName &p_node) const { +Point2 AnimationTreePlayer::node_get_position(const StringName &p_node) const { ERR_FAIL_COND_V(!node_map.has(p_node), Point2()); return node_map[p_node]->pos; @@ -1752,7 +1752,7 @@ void AnimationTreePlayer::_bind_methods() { ClassDB::bind_method(D_METHOD("timescale_node_set_scale", "id", "scale"), &AnimationTreePlayer::timescale_node_set_scale); ClassDB::bind_method(D_METHOD("timescale_node_get_scale", "id"), &AnimationTreePlayer::timescale_node_get_scale); - ClassDB::bind_method(D_METHOD("timeseek_node_seek", "id", "pos_sec"), &AnimationTreePlayer::timeseek_node_seek); + ClassDB::bind_method(D_METHOD("timeseek_node_seek", "id", "seconds"), &AnimationTreePlayer::timeseek_node_seek); ClassDB::bind_method(D_METHOD("transition_node_set_input_count", "id", "count"), &AnimationTreePlayer::transition_node_set_input_count); ClassDB::bind_method(D_METHOD("transition_node_get_input_count", "id"), &AnimationTreePlayer::transition_node_get_input_count); @@ -1767,8 +1767,8 @@ void AnimationTreePlayer::_bind_methods() { ClassDB::bind_method(D_METHOD("transition_node_set_current", "id", "input_idx"), &AnimationTreePlayer::transition_node_set_current); ClassDB::bind_method(D_METHOD("transition_node_get_current", "id"), &AnimationTreePlayer::transition_node_get_current); - ClassDB::bind_method(D_METHOD("node_set_pos", "id", "screen_pos"), &AnimationTreePlayer::node_set_pos); - ClassDB::bind_method(D_METHOD("node_get_pos", "id"), &AnimationTreePlayer::node_get_pos); + ClassDB::bind_method(D_METHOD("node_set_position", "id", "screen_position"), &AnimationTreePlayer::node_set_position); + ClassDB::bind_method(D_METHOD("node_get_position", "id"), &AnimationTreePlayer::node_get_position); ClassDB::bind_method(D_METHOD("remove_node", "id"), &AnimationTreePlayer::remove_node); ClassDB::bind_method(D_METHOD("connect_nodes", "id", "dst_id", "dst_input_idx"), &AnimationTreePlayer::connect_nodes); diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h index 609430340b..806a4f6604 100644 --- a/scene/animation/animation_tree_player.h +++ b/scene/animation/animation_tree_player.h @@ -417,10 +417,10 @@ public: void transition_node_set_current(const StringName &p_node, int p_current); int transition_node_get_current(const StringName &p_node) const; - void node_set_pos(const StringName &p_node, const Vector2 &p_pos); //for display + void node_set_position(const StringName &p_node, const Vector2 &p_pos); //for display /* GETS */ - Point2 node_get_pos(const StringName &p_node) const; //for display + Point2 node_get_position(const StringName &p_node) const; //for display NodeType node_get_type(const StringName &p_node) const; |