diff --git a/.gitignore b/.gitignore index be68026..d5e12a4 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ addons/imgui-godot/include/ scons_cache doc/**/addons/ addons/imgui-godot/include/imgui-version.txt +export/ diff --git a/doc/examples/GdsGameProject/README.md b/doc/examples/GdsGameProject/README.md new file mode 100644 index 0000000..a16d223 --- /dev/null +++ b/doc/examples/GdsGameProject/README.md @@ -0,0 +1,11 @@ +# GDScript Game Project + +Run: + +``` +godotenv addons install +``` + +(or install from AssetLib) + +TODO: explain stuff diff --git a/doc/examples/GdsGameProject/addons.json b/doc/examples/GdsGameProject/addons.json new file mode 100644 index 0000000..f74fb9e --- /dev/null +++ b/doc/examples/GdsGameProject/addons.json @@ -0,0 +1,8 @@ +{ + "addons": { + "imgui-godot": { + "url": "../../../../addons/imgui-godot", + "source": "symlink" + } + } +} diff --git a/doc/examples/GdsGameProject/export_presets.cfg b/doc/examples/GdsGameProject/export_presets.cfg new file mode 100644 index 0000000..b7a0880 --- /dev/null +++ b/doc/examples/GdsGameProject/export_presets.cfg @@ -0,0 +1,125 @@ +[preset.0] + +name="Windows" +platform="Windows Desktop" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="addons/imgui-godot/*" +export_path="../export/GdsGameProject.exe" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +binary_format/architecture="x86_64" +codesign/enable=false +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PackedStringArray() +application/modify_resources=true +application/icon="" +application/console_wrapper_icon="" +application/icon_interpolation=4 +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="" +application/file_description="" +application/copyright="" +application/trademarks="" +application/export_angle=0 +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}' +$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}' +$trigger = New-ScheduledTaskTrigger -Once -At 00:00 +$settings = New-ScheduledTaskSettingsSet +$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings +Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true +Start-ScheduledTask -TaskName godot_remote_debug +while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 } +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue" +ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue +Remove-Item -Recurse -Force '{temp_dir}'" + +[preset.1] + +name="Windows (dev)" +platform="Windows Desktop" +runnable=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="../export/GdsGameProject.exe" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.1.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +binary_format/architecture="x86_64" +codesign/enable=false +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PackedStringArray() +application/modify_resources=true +application/icon="" +application/console_wrapper_icon="" +application/icon_interpolation=4 +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="" +application/file_description="" +application/copyright="" +application/trademarks="" +application/export_angle=0 +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}' +$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}' +$trigger = New-ScheduledTaskTrigger -Once -At 00:00 +$settings = New-ScheduledTaskSettingsSet +$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings +Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true +Start-ScheduledTask -TaskName godot_remote_debug +while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 } +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue" +ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue +Remove-Item -Recurse -Force '{temp_dir}'" diff --git a/doc/examples/GdsGameProject/icon.svg b/doc/examples/GdsGameProject/icon.svg new file mode 100644 index 0000000..3fe4f4a --- /dev/null +++ b/doc/examples/GdsGameProject/icon.svg @@ -0,0 +1 @@ + diff --git a/doc/examples/GdsGameProject/icon.svg.import b/doc/examples/GdsGameProject/icon.svg.import new file mode 100644 index 0000000..13f0282 --- /dev/null +++ b/doc/examples/GdsGameProject/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bwwgygwkoe4ei" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/doc/examples/GdsGameProject/main.gd b/doc/examples/GdsGameProject/main.gd new file mode 100644 index 0000000..178d9c6 --- /dev/null +++ b/doc/examples/GdsGameProject/main.gd @@ -0,0 +1,14 @@ +extends Node + +func _ready() -> void: + if DisplayServer.window_get_vsync_mode() == DisplayServer.VSYNC_DISABLED: + var refreshRate := DisplayServer.screen_get_refresh_rate() + Engine.max_fps = int(refreshRate) if refreshRate > 0.0 else 60 + + if Engine.has_singleton("ImGuiAPI"): + var ImGui: Object = Engine.get_singleton("ImGuiAPI") + var io: Object = ImGui.GetIO() + io.ConfigFlags |= ImGui.ConfigFlags_ViewportsEnable + +func _process(_delta: float) -> void: + pass diff --git a/doc/examples/GdsGameProject/main.tscn b/doc/examples/GdsGameProject/main.tscn new file mode 100644 index 0000000..cb658cf --- /dev/null +++ b/doc/examples/GdsGameProject/main.tscn @@ -0,0 +1,13 @@ +[gd_scene load_steps=4 format=3 uid="uid://cmvrg5mco0rv7"] + +[ext_resource type="Script" path="res://main.gd" id="1_a75q1"] +[ext_resource type="Texture2D" uid="uid://bwwgygwkoe4ei" path="res://icon.svg" id="1_v7ads"] +[ext_resource type="Script" path="res://sprite.gd" id="3_ngin8"] + +[node name="Node2D" type="Node2D"] +script = ExtResource("1_a75q1") + +[node name="Sprite1" type="Sprite2D" parent="."] +position = Vector2(275, 236) +texture = ExtResource("1_v7ads") +script = ExtResource("3_ngin8") diff --git a/doc/examples/GdsGameProject/project.godot b/doc/examples/GdsGameProject/project.godot new file mode 100644 index 0000000..1e763e2 --- /dev/null +++ b/doc/examples/GdsGameProject/project.godot @@ -0,0 +1,34 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="GdsGameProject" +run/main_scene="res://main.tscn" +config/features=PackedStringArray("4.2", "Forward Plus") +config/icon="res://icon.svg" + +[autoload] + +ImGuiRoot="*res://addons/imgui-godot/data/ImGuiRoot.tscn" + +[debug] + +gdscript/warnings/shadowed_global_identifier=0 +gdscript/warnings/untyped_declaration=1 + +[display] + +window/subwindows/embed_subwindows=false +window/vsync/vsync_mode=0 + +[editor_plugins] + +enabled=PackedStringArray("res://addons/imgui-godot/plugin.cfg") diff --git a/doc/examples/GdsGameProject/sprite.gd b/doc/examples/GdsGameProject/sprite.gd new file mode 100644 index 0000000..f7ff2fa --- /dev/null +++ b/doc/examples/GdsGameProject/sprite.gd @@ -0,0 +1,15 @@ +extends Sprite2D + +func _ready() -> void: + pass + +func _process(delta: float) -> void: + position.x += delta * 10.0 + + if Engine.has_singleton("ImGuiAPI"): + var ImGui: Object = Engine.get_singleton("ImGuiAPI") + ImGui.Begin("SpriteTool: %s" % name, [], ImGui.WindowFlags_AlwaysAutoResize) + var pos: Array = [position.x, position.y] + if ImGui.DragInt2("position", pos): + position = Vector2(pos[0], pos[1]) + ImGui.End()