summaryrefslogtreecommitdiff
path: root/demos/misc/window_management/control.gd
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-05-07 20:05:55 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-05-07 20:05:55 -0300
commit5f51623547291181da053d4811a94acb75c60979 (patch)
tree3c5373cad41c703d2ff04a9b9e0b90f657634c9f /demos/misc/window_management/control.gd
parent2a3ded86de1234207230a6873d699636190d7df7 (diff)
parent48afa1d2847bdf7d23c21a76494c4789d3bdc9e1 (diff)
Merge pull request #1846 from hurikhan/pr_wm_demo_input_fix
window_management demo -- input fix
Diffstat (limited to 'demos/misc/window_management/control.gd')
-rw-r--r--demos/misc/window_management/control.gd10
1 files changed, 9 insertions, 1 deletions
diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd
index 5eb5817619..1609dda699 100644
--- a/demos/misc/window_management/control.gd
+++ b/demos/misc/window_management/control.gd
@@ -1,6 +1,8 @@
extends Control
+var mousepos
+
func _fixed_process(delta):
var modetext = "Mode:\n"
@@ -31,7 +33,7 @@ func _fixed_process(delta):
get_node("Label_Size").set_text(str("Size:\n", OS.get_window_size() ) )
- get_node("Label_MousePosition").set_text(str("Mouse Position:\n", Input.get_mouse_pos() ) )
+ get_node("Label_MousePosition").set_text(str("Mouse Position:\n", mousepos ) )
get_node("Label_Screen_Count").set_text( str("Screen_Count:\n", OS.get_screen_count() ) )
@@ -126,6 +128,12 @@ func check_wm_api():
func _ready():
if( check_wm_api() ):
set_fixed_process(true)
+ set_process_input(true)
+
+
+func _input(ev):
+ if (ev.type==InputEvent.MOUSE_MOTION):
+ mousepos = ev.pos
func _on_Button_MoveTo_pressed():