summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-06-29 22:41:02 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-06-29 22:41:02 -0300
commit01632a824ee7e2326aa90b32d75c2fe09f61a37e (patch)
tree86d97af34596130fb69bf444781b7ca8fdc8c20d /scene/gui
parent97731696c9e45a351d64660b46c6d027f3b0a25e (diff)
Bug Fixes
-=-=-=-=- -Documentation now shows overridable theme values (though this needs to be documented). -Detect when object transform is flipped and flip normals too. -TileMap can specify bounce and friction for collision. -Removed limit of 4 lights per object -Added is_hovered() to buttons.
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/base_button.cpp5
-rw-r--r--scene/gui/base_button.h2
-rw-r--r--scene/gui/control.cpp2
3 files changed, 8 insertions, 1 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 2e03871063..ac2417d539 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -276,6 +276,10 @@ bool BaseButton::is_pressed() const {
return toggle_mode?status.pressed:status.press_attempt;
}
+bool BaseButton::is_hovered() const {
+
+ return status.hovering;
+}
BaseButton::DrawMode BaseButton::get_draw_mode() const {
@@ -337,6 +341,7 @@ void BaseButton::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_input_event"),&BaseButton::_input_event);
ObjectTypeDB::bind_method(_MD("set_pressed","pressed"),&BaseButton::set_pressed);
ObjectTypeDB::bind_method(_MD("is_pressed"),&BaseButton::is_pressed);
+ ObjectTypeDB::bind_method(_MD("is_hovered"),&BaseButton::is_hovered);
ObjectTypeDB::bind_method(_MD("set_toggle_mode","enabled"),&BaseButton::set_toggle_mode);
ObjectTypeDB::bind_method(_MD("is_toggle_mode"),&BaseButton::is_toggle_mode);
ObjectTypeDB::bind_method(_MD("set_disabled","disabled"),&BaseButton::set_disabled);
diff --git a/scene/gui/base_button.h b/scene/gui/base_button.h
index 65563ddc03..a2c640b9cf 100644
--- a/scene/gui/base_button.h
+++ b/scene/gui/base_button.h
@@ -83,6 +83,8 @@ public:
bool is_pressed() const; ///< return wether button is pressed (toggled in)
bool is_pressing() const; ///< return wether button is pressed (toggled in)
+ bool is_hovered() const;
+
void set_pressed(bool p_pressed); ///only works in toggle mode
void set_toggle_mode(bool p_on);
bool is_toggle_mode() const;
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 4b4b4b3c73..6878793360 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -1002,7 +1002,7 @@ void Control::_window_input_event(InputEvent p_event) {
}
- p_event.mouse_button.global_x = pos.x;
+ p_event.mouse_button.global_x = pos.x;
p_event.mouse_button.global_y = pos.y;
pos = window->focus_inv_xform.xform(pos);