Demo misc/window_management added
This commit is contained in:
parent
f9d0de0d2a
commit
107d2a373a
5 changed files with 45 additions and 0 deletions
39
demos/misc/window_management/control.gd
Normal file
39
demos/misc/window_management/control.gd
Normal file
|
@ -0,0 +1,39 @@
|
|||
|
||||
extends Control
|
||||
|
||||
func _fixed_process(delta):
|
||||
if(OS.is_fullscreen()):
|
||||
get_node("Label_Fullscreen").set_text("Mode:\nFullscreen")
|
||||
else:
|
||||
get_node("Label_Fullscreen").set_text("Mode:\nWindowed")
|
||||
|
||||
get_node("Label_Position").set_text( str("Position:\n", OS.get_window_position() ) )
|
||||
|
||||
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_Screen0_Resolution").set_text( str("Screen0 Resolution:\n", OS.get_screen_size() ) )
|
||||
|
||||
if(OS.get_screen_count() > 1):
|
||||
get_node("Label_Screen1_Resolution").show()
|
||||
get_node("Label_Screen1_Resolution").set_text( str("Screen0 Resolution:\n", OS.get_screen_size(1) ) )
|
||||
|
||||
|
||||
func _ready():
|
||||
set_fixed_process(true)
|
||||
|
||||
|
||||
func _on_Fullscreen_toggled( pressed ):
|
||||
if(pressed):
|
||||
OS.set_fullscreen(true)
|
||||
else:
|
||||
OS.set_fullscreen(false)
|
||||
|
||||
|
||||
func _on_Button_MoveTo_pressed():
|
||||
OS.set_window_position( Vector2(100,100) )
|
||||
|
||||
|
||||
func _on_Button_Resize_pressed():
|
||||
OS.set_window_size( Vector2(1024,768) )
|
5
demos/misc/window_management/engine.cfg
Normal file
5
demos/misc/window_management/engine.cfg
Normal file
|
@ -0,0 +1,5 @@
|
|||
[application]
|
||||
|
||||
name="window_management"
|
||||
main_scene="res://window_management.scn"
|
||||
icon="icon.png"
|
BIN
demos/misc/window_management/icon.png
Normal file
BIN
demos/misc/window_management/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
1
demos/misc/window_management/icon.png.flags
Normal file
1
demos/misc/window_management/icon.png.flags
Normal file
|
@ -0,0 +1 @@
|
|||
gen_mipmaps=false
|
BIN
demos/misc/window_management/window_management.scn
Normal file
BIN
demos/misc/window_management/window_management.scn
Normal file
Binary file not shown.
Loading…
Reference in a new issue