summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/input_default.cpp10
-rw-r--r--main/input_default.h4
-rw-r--r--main/tests/test_gui.cpp36
3 files changed, 25 insertions, 25 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp
index 918f3c150c..81e04a84a9 100644
--- a/main/input_default.cpp
+++ b/main/input_default.cpp
@@ -340,7 +340,7 @@ void InputDefault::parse_input_event(const InputEvent &p_event) {
Point2 pos = Point2(p_event.mouse_button.global_x, p_event.mouse_button.global_y);
if (mouse_pos != pos) {
- set_mouse_pos(pos);
+ set_mouse_position(pos);
}
} break;
case InputEvent::MOUSE_MOTION: {
@@ -456,16 +456,16 @@ void InputDefault::set_main_loop(MainLoop *p_main_loop) {
main_loop = p_main_loop;
}
-void InputDefault::set_mouse_pos(const Point2 &p_posf) {
+void InputDefault::set_mouse_position(const Point2 &p_posf) {
mouse_speed_track.update(p_posf - mouse_pos);
mouse_pos = p_posf;
if (custom_cursor.is_valid()) {
- VisualServer::get_singleton()->cursor_set_pos(get_mouse_pos());
+ VisualServer::get_singleton()->cursor_set_pos(get_mouse_position());
}
}
-Point2 InputDefault::get_mouse_pos() const {
+Point2 InputDefault::get_mouse_position() const {
return mouse_pos;
}
@@ -560,7 +560,7 @@ void InputDefault::set_custom_mouse_cursor(const RES &p_cursor, const Vector2 &p
set_mouse_mode(MOUSE_MODE_HIDDEN);
VisualServer::get_singleton()->cursor_set_visible(true);
VisualServer::get_singleton()->cursor_set_texture(custom_cursor->get_rid(), p_hotspot, 0, region);
- VisualServer::get_singleton()->cursor_set_pos(get_mouse_pos());
+ VisualServer::get_singleton()->cursor_set_pos(get_mouse_position());
}
}
diff --git a/main/input_default.h b/main/input_default.h
index a611047cb3..55b7555ef9 100644
--- a/main/input_default.h
+++ b/main/input_default.h
@@ -196,7 +196,7 @@ public:
virtual Vector3 get_magnetometer() const;
virtual Vector3 get_gyroscope() const;
- virtual Point2 get_mouse_pos() const;
+ virtual Point2 get_mouse_position() const;
virtual Point2 get_last_mouse_speed() const;
virtual int get_mouse_button_mask() const;
@@ -215,7 +215,7 @@ public:
virtual void stop_joy_vibration(int p_device);
void set_main_loop(MainLoop *main_loop);
- void set_mouse_pos(const Point2 &p_posf);
+ void set_mouse_position(const Point2 &p_posf);
void action_press(const StringName &p_action);
void action_release(const StringName &p_action);
diff --git a/main/tests/test_gui.cpp b/main/tests/test_gui.cpp
index cf32bf7073..3d0b96ae5b 100644
--- a/main/tests/test_gui.cpp
+++ b/main/tests/test_gui.cpp
@@ -94,7 +94,7 @@ public:
Sprite *sp = memnew( Sprite );
sp->set_texture( vp->get_render_target_texture() );
//sp->set_texture( ResourceLoader::load("res://ball.png") );
- sp->set_pos(Point2(300,300));
+ sp->set_position(Point2(300,300));
get_root()->add_child(sp);
@@ -113,7 +113,7 @@ public:
Label *label = memnew(Label);
- label->set_pos(Point2(80, 90));
+ label->set_position(Point2(80, 90));
label->set_size(Point2(170, 80));
label->set_align(Label::ALIGN_FILL);
//label->set_text("There");
@@ -123,7 +123,7 @@ public:
Button *button = memnew(Button);
- button->set_pos(Point2(20, 20));
+ button->set_position(Point2(20, 20));
button->set_size(Point2(1, 1));
button->set_text("This is a biggie button");
@@ -141,7 +141,7 @@ public:
Ref<ImageTexture> tt = memnew( ImageTexture );
tt->create_from_image(img);
tf->set_texture(tt);
- tf->set_pos(Point2(50,50));
+ tf->set_position(Point2(50,50));
//tf->set_scale(Point2(0.3,0.3));
@@ -151,7 +151,7 @@ public:
Tree *tree = memnew(Tree);
tree->set_columns(2);
- tree->set_pos(Point2(230, 210));
+ tree->set_position(Point2(230, 210));
tree->set_size(Point2(150, 250));
TreeItem *item = tree->create_item();
@@ -192,14 +192,14 @@ public:
LineEdit *line_edit = memnew(LineEdit);
- line_edit->set_pos(Point2(30, 190));
+ line_edit->set_position(Point2(30, 190));
line_edit->set_size(Point2(180, 1));
frame->add_child(line_edit);
HScrollBar *hscroll = memnew(HScrollBar);
- hscroll->set_pos(Point2(30, 290));
+ hscroll->set_position(Point2(30, 290));
hscroll->set_size(Point2(180, 1));
hscroll->set_max(10);
hscroll->set_page(4);
@@ -208,7 +208,7 @@ public:
SpinBox *spin = memnew(SpinBox);
- spin->set_pos(Point2(30, 260));
+ spin->set_position(Point2(30, 260));
spin->set_size(Point2(120, 1));
frame->add_child(spin);
@@ -216,7 +216,7 @@ public:
ProgressBar *progress = memnew(ProgressBar);
- progress->set_pos(Point2(30, 330));
+ progress->set_position(Point2(30, 330));
progress->set_size(Point2(120, 1));
frame->add_child(progress);
@@ -225,7 +225,7 @@ public:
MenuButton *menu_button = memnew(MenuButton);
menu_button->set_text("I'm a menu!");
- menu_button->set_pos(Point2(30, 380));
+ menu_button->set_position(Point2(30, 380));
menu_button->set_size(Point2(1, 1));
frame->add_child(menu_button);
@@ -244,7 +244,7 @@ public:
options->add_item("Hello, testing");
options->add_item("My Dearest");
- options->set_pos(Point2(230, 180));
+ options->set_position(Point2(230, 180));
options->set_size(Point2(1, 1));
frame->add_child(options);
@@ -253,7 +253,7 @@ public:
Tree * tree = memnew( Tree );
tree->set_columns(2);
- tree->set_pos( Point2( 230,210 ) );
+ tree->set_position( Point2( 230,210 ) );
tree->set_size( Point2( 150,250 ) );
@@ -281,7 +281,7 @@ public:
RichTextLabel *richtext = memnew(RichTextLabel);
- richtext->set_pos(Point2(600, 210));
+ richtext->set_position(Point2(600, 210));
richtext->set_size(Point2(180, 250));
richtext->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, 20);
@@ -337,21 +337,21 @@ public:
tabc->add_child(ctl);
label = memnew(Label);
label->set_text("Some Label");
- label->set_pos(Point2(20, 20));
+ label->set_position(Point2(20, 20));
ctl->add_child(label);
ctl = memnew(Control);
ctl->set_name("tab 3");
button = memnew(Button);
button->set_text("Some Button");
- button->set_pos(Point2(30, 50));
+ button->set_position(Point2(30, 50));
ctl->add_child(button);
tabc->add_child(ctl);
frame->add_child(tabc);
- tabc->set_pos(Point2(400, 210));
+ tabc->set_position(Point2(400, 210));
tabc->set_size(Point2(180, 250));
/*Ref<ImageTexture> text = memnew( ImageTexture );
@@ -359,14 +359,14 @@ public:
Sprite* sprite = memnew(Sprite);
sprite->set_texture(text);
- sprite->set_pos(Point2(300, 300));
+ sprite->set_position(Point2(300, 300));
frame->add_child(sprite);
sprite->show();
Sprite* sprite2 = memnew(Sprite);
sprite->set_texture(text);
sprite->add_child(sprite2);
- sprite2->set_pos(Point2(50, 50));
+ sprite2->set_position(Point2(50, 50));
sprite2->show();*/
}
};