diff --git a/misc/os_test/README.md b/misc/os_test/README.md new file mode 100644 index 00000000..9fdeb342 --- /dev/null +++ b/misc/os_test/README.md @@ -0,0 +1,37 @@ +# Operating System Testing + +This demo showcases various OS-specific features in Godot. +It can be used to test Godot while porting it to a +new platform or to check for regressions. + +In a nutshell, this demo shows how you can get information from the +operating system, or interact with the operating system. + +Language: GDScript and some [C#](https://docs.godotengine.org/en/latest/getting_started/scripting/c_sharp/index.html) +(Mono is NOT required to run this demo) + +Renderer: GLES 2 + +## How does it work? + +The [`OS`](https://docs.godotengine.org/en/latest/classes/class_os.html) +class provides an abstraction layer over the platform-dependent code. +OS wraps the most common functionality to communicate with the host +operating system, such as the clipboard, video driver, date and time, +timers, environment variables, execution of binaries, command line, etc. + +The buttons are connected to a node with the `actions.gd` script, which +perform actions using the OS class. +The text on the left is filled in using the `os_test.gd` script, +which gathers information about the OS using the OS class. + +On a Mono-enabled version of Godot, Godot will load `MonoTest.cs` into +the `MonoTest` node. Then, information determined by +[`C# preprocessor defines`](https://docs.godotengine.org/en/latest/getting_started/scripting/c_sharp/c_sharp_features.html#preprocessor-defines) +will be added to the left panel. + +## Screenshots + +![Top HiDPI](screenshots/top-hidpi.png) + +![Mono](screenshots/mono.png) diff --git a/misc/os_test/actions.gd b/misc/os_test/actions.gd index eef19073..3f5bdb71 100644 --- a/misc/os_test/actions.gd +++ b/misc/os_test/actions.gd @@ -1,4 +1,4 @@ -extends VBoxContainer +extends Node func _on_OpenShellWeb_pressed(): diff --git a/misc/os_test/os_test.gd b/misc/os_test/os_test.gd index 759efb0e..c8c6e078 100644 --- a/misc/os_test/os_test.gd +++ b/misc/os_test/os_test.gd @@ -1,4 +1,4 @@ -extends Panel +extends Node onready var rtl = $HBoxContainer/Features onready var mono_test = $MonoTest diff --git a/misc/os_test/screenshots/.gdignore b/misc/os_test/screenshots/.gdignore new file mode 100644 index 00000000..e69de29b diff --git a/misc/os_test/screenshots/mono.png b/misc/os_test/screenshots/mono.png new file mode 100644 index 00000000..16cd4c26 Binary files /dev/null and b/misc/os_test/screenshots/mono.png differ diff --git a/misc/os_test/screenshots/top-hidpi.png b/misc/os_test/screenshots/top-hidpi.png new file mode 100644 index 00000000..aec67a84 Binary files /dev/null and b/misc/os_test/screenshots/top-hidpi.png differ