diff options
author | hurikhan <m4r10.5ch14ck@gmail.com> | 2015-05-06 23:07:11 -0400 |
---|---|---|
committer | hurikhan <m4r10.5ch14ck@gmail.com> | 2015-05-06 23:07:11 -0400 |
commit | 48afa1d2847bdf7d23c21a76494c4789d3bdc9e1 (patch) | |
tree | 18eb92b3c9c57cbcf99ab72d6613d211be5ac7ab /demos/misc | |
parent | 7156aff16041ea56ff1f3aea2a622c130bcca7a9 (diff) |
window_management input fix
Diffstat (limited to 'demos/misc')
-rw-r--r-- | demos/misc/window_management/control.gd | 10 | ||||
-rw-r--r-- | demos/misc/window_management/window_management.scn | bin | 5129 -> 5132 bytes |
2 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(): diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn Binary files differindex c7d6260df6..8db43b6638 100644 --- a/demos/misc/window_management/window_management.scn +++ b/demos/misc/window_management/window_management.scn |