diff options
author | hurikhan <m4r10.5ch14ck@gmail.com> | 2015-01-17 19:43:12 +0900 |
---|---|---|
committer | hurikhan <m4r10.5ch14ck@gmail.com> | 2015-01-17 19:43:12 +0900 |
commit | f1dc00e380439078c93d00af2f85d138a9400b2e (patch) | |
tree | 65889771c96d5831021c1a3a99e47e50e80194a6 /demos/misc/window_management | |
parent | 6185949f6a4f6eae78d8afca2dd787dbf063d675 (diff) |
* cleanup window state handling
* first attemps in handling ALT+TABa (WIP)
Diffstat (limited to 'demos/misc/window_management')
-rw-r--r-- | demos/misc/window_management/control.gd | 28 | ||||
-rw-r--r-- | demos/misc/window_management/window_management.scn | bin | 4111 -> 4052 bytes |
2 files changed, 17 insertions, 11 deletions
diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index fd746cf036..4929b1376c 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -25,9 +25,9 @@ func _fixed_process(delta): get_node("Label_Size").set_text(str("Size:\n", OS.get_window_size() ) ) - get_node("Label_Screen_Count").set_text( str("Screens:\n", OS.get_screen_count() ) ) + get_node("Label_Screen_Count").set_text( str("Screen_Count:\n", OS.get_screen_count() ) ) - get_node("Label_Screen_Current").set_text( str("Current:\n", OS.get_screen() ) ) + get_node("Label_Screen_Current").set_text( str("Screen:\n", OS.get_screen() ) ) get_node("Label_Screen0_Resolution").set_text( str("Screen0 Resolution:\n", OS.get_screen_size() ) ) @@ -35,12 +35,14 @@ func _fixed_process(delta): if(OS.get_screen_count() > 1): + get_node("Button_Screen0").show() get_node("Button_Screen1").show() get_node("Label_Screen1_Resolution").show() get_node("Label_Screen1_Position").show() get_node("Label_Screen1_Resolution").set_text( str("Screen1 Resolution:\n", OS.get_screen_size(1) ) ) get_node("Label_Screen1_Position").set_text( str("Screen1 Position:\n", OS.get_screen_position(1) ) ) else: + get_node("Button_Screen0").hide() get_node("Button_Screen1").hide() get_node("Label_Screen1_Resolution").hide() get_node("Label_Screen1_Position").hide() @@ -57,19 +59,14 @@ func _fixed_process(delta): if( Input.is_action_pressed("ui_down")): OS.set_fullscreen(false) + get_node("Button_Fullscreen").set_pressed( OS.is_fullscreen() ) get_node("Button_FixedSize").set_pressed( !OS.is_resizable() ) get_node("Button_Minimized").set_pressed( OS.is_minimized() ) get_node("Button_Maximized").set_pressed( OS.is_maximized() ) - -func _ready(): - set_fixed_process(true) -func _on_Fullscreen_toggled( pressed ): - if(pressed): - OS.set_fullscreen(true) - else: - OS.set_fullscreen(false) +func _ready(): + set_fixed_process(true) func _on_Button_MoveTo_pressed(): @@ -88,12 +85,18 @@ func _on_Button_Screen1_pressed(): OS.set_screen(1) +func _on_Button_Fullscreen_pressed(): + if(OS.is_fullscreen()): + OS.set_fullscreen(false) + else: + OS.set_fullscreen(true) + + func _on_Button_FixedSize_pressed(): if(OS.is_resizable()): OS.set_resizable(false) else: OS.set_resizable(true) - func _on_Button_Minimized_pressed(): @@ -108,3 +111,6 @@ func _on_Button_Maximized_pressed(): OS.set_maximized(false) else: OS.set_maximized(true) + + + diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn Binary files differindex 635f6f6f28..3d62d4ecc1 100644 --- a/demos/misc/window_management/window_management.scn +++ b/demos/misc/window_management/window_management.scn |