commit a44071134f0f04f320907ba5627d2129ec45afe6 Author: BuyMyMojo Date: Sun Apr 13 12:42:20 2025 +1000 Create quick test for reading controller joystick diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f28239b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +charset = utf-8 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b4ec56a --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# Godot 4+ specific ignores +.godot/ +/android/ +/Builds \ No newline at end of file diff --git a/Fonts/TX-02-Black.ttf b/Fonts/TX-02-Black.ttf new file mode 100644 index 0000000..4446dac Binary files /dev/null and b/Fonts/TX-02-Black.ttf differ diff --git a/Fonts/TX-02-Black.ttf.import b/Fonts/TX-02-Black.ttf.import new file mode 100644 index 0000000..de80e9e --- /dev/null +++ b/Fonts/TX-02-Black.ttf.import @@ -0,0 +1,35 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://c6rkayxx57pw3" +path="res://.godot/imported/TX-02-Black.ttf-324ccd86f39a463a1df4b89f45431295.fontdata" + +[deps] + +source_file="res://Fonts/TX-02-Black.ttf" +dest_files=["res://.godot/imported/TX-02-Black.ttf-324ccd86f39a463a1df4b89f45431295.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/Fonts/TX-02-Bold.ttf b/Fonts/TX-02-Bold.ttf new file mode 100644 index 0000000..6884e07 Binary files /dev/null and b/Fonts/TX-02-Bold.ttf differ diff --git a/Fonts/TX-02-Bold.ttf.import b/Fonts/TX-02-Bold.ttf.import new file mode 100644 index 0000000..1eeaec7 --- /dev/null +++ b/Fonts/TX-02-Bold.ttf.import @@ -0,0 +1,35 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://cy8dummgd480m" +path="res://.godot/imported/TX-02-Bold.ttf-00c98c2a59fe7e7f9469b005d3a3f06b.fontdata" + +[deps] + +source_file="res://Fonts/TX-02-Bold.ttf" +dest_files=["res://.godot/imported/TX-02-Bold.ttf-00c98c2a59fe7e7f9469b005d3a3f06b.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/Fonts/TX-02-Regular.ttf b/Fonts/TX-02-Regular.ttf new file mode 100644 index 0000000..abc160a Binary files /dev/null and b/Fonts/TX-02-Regular.ttf differ diff --git a/Fonts/TX-02-Regular.ttf.import b/Fonts/TX-02-Regular.ttf.import new file mode 100644 index 0000000..8279ab1 --- /dev/null +++ b/Fonts/TX-02-Regular.ttf.import @@ -0,0 +1,35 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://bi6h0efxwuf8w" +path="res://.godot/imported/TX-02-Regular.ttf-39cc92dee4bae6115a1306370e9053da.fontdata" + +[deps] + +source_file="res://Fonts/TX-02-Regular.ttf" +dest_files=["res://.godot/imported/TX-02-Regular.ttf-39cc92dee4bae6115a1306370e9053da.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=true +disable_embedded_bitmaps=true +multichannel_signed_distance_field=true +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/Scripts/axis_display.gd b/Scripts/axis_display.gd new file mode 100644 index 0000000..59496d0 --- /dev/null +++ b/Scripts/axis_display.gd @@ -0,0 +1,11 @@ +extends VBoxContainer + +@onready var x_progress_bar: ProgressBar = $"X-ProgressBar" +@onready var y_progress_bar: ProgressBar = $"Y-ProgressBar" + +func _process(delta: float) -> void: + var LR = Input.get_axis("move_left", "move_right") + var UD = Input.get_axis("move_up", "move_down") + + x_progress_bar.value = LR + y_progress_bar.value = UD diff --git a/Scripts/axis_display.gd.uid b/Scripts/axis_display.gd.uid new file mode 100644 index 0000000..985f383 --- /dev/null +++ b/Scripts/axis_display.gd.uid @@ -0,0 +1 @@ +uid://6jaio7r4ptwa diff --git a/controller_test.tscn b/controller_test.tscn new file mode 100644 index 0000000..0b76426 --- /dev/null +++ b/controller_test.tscn @@ -0,0 +1,68 @@ +[gd_scene load_steps=5 format=3 uid="uid://c63y7xw8m20dt"] + +[ext_resource type="Script" uid="uid://6jaio7r4ptwa" path="res://Scripts/axis_display.gd" id="1_cxxsp"] +[ext_resource type="FontFile" uid="uid://c6rkayxx57pw3" path="res://Fonts/TX-02-Black.ttf" id="1_d14nv"] +[ext_resource type="FontFile" uid="uid://bi6h0efxwuf8w" path="res://Fonts/TX-02-Regular.ttf" id="2_tlyjq"] + +[sub_resource type="LabelSettings" id="LabelSettings_tlyjq"] +font = ExtResource("1_d14nv") +font_size = 50 +shadow_size = 10 +shadow_color = Color(0, 0, 0, 0.196078) +shadow_offset = Vector2(2, 2) + +[node name="ControllerTest" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Backround" type="ColorRect" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0.24025, 0.155, 0.31, 1) + +[node name="CenterContainer" type="CenterContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Axis-Display" type="VBoxContainer" parent="CenterContainer"] +layout_mode = 2 +alignment = 1 +script = ExtResource("1_cxxsp") + +[node name="X-Axis" type="Label" parent="CenterContainer/Axis-Display"] +layout_mode = 2 +text = "X-Axis:" +label_settings = SubResource("LabelSettings_tlyjq") + +[node name="X-ProgressBar" type="ProgressBar" parent="CenterContainer/Axis-Display"] +custom_minimum_size = Vector2(600, 0) +layout_mode = 2 +theme_override_fonts/font = ExtResource("2_tlyjq") +theme_override_font_sizes/font_size = 48 +min_value = -1.0 +max_value = 1.0 + +[node name="Y-Axis" type="Label" parent="CenterContainer/Axis-Display"] +layout_mode = 2 +text = "Y-Axis:" +label_settings = SubResource("LabelSettings_tlyjq") + +[node name="Y-ProgressBar" type="ProgressBar" parent="CenterContainer/Axis-Display"] +custom_minimum_size = Vector2(600, 0) +layout_mode = 2 +theme_override_fonts/font = ExtResource("2_tlyjq") +theme_override_font_sizes/font_size = 48 +min_value = -1.0 +max_value = 1.0 diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..3326297 --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,161 @@ +[preset.0] + +name="Linux" +platform="Linux" +runnable=true +advanced_options=false +dedicated_server=false +custom_features="" +export_filter="scenes" +export_files=PackedStringArray("res://controller_test.tscn") +include_filter="" +exclude_filter="" +export_path="Builds/browser-testing.x86_64" +patches=PackedStringArray() +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=1 + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=true +texture_format/s3tc_bptc=true +texture_format/etc2_astc=false +binary_format/architecture="x86_64" +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="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" +dotnet/include_scripts_content=false +dotnet/include_debug_symbols=true +dotnet/embed_build_outputs=false + +[preset.1] + +name="Web" +platform="Web" +runnable=true +advanced_options=false +dedicated_server=false +custom_features="" +export_filter="scenes" +export_files=PackedStringArray("res://controller_test.tscn") +include_filter="" +exclude_filter="" +export_path="Builds/Web/index.html" +patches=PackedStringArray() +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=1 + +[preset.1.options] + +custom_template/debug="" +custom_template/release="" +variant/extensions_support=false +variant/thread_support=false +vram_texture_compression/for_desktop=true +vram_texture_compression/for_mobile=false +html/export_icon=true +html/custom_html_shell="" +html/head_include="" +html/canvas_resize_policy=2 +html/focus_canvas_on_start=true +html/experimental_virtual_keyboard=false +progressive_web_app/enabled=false +progressive_web_app/ensure_cross_origin_isolation_headers=true +progressive_web_app/offline_page="" +progressive_web_app/display=1 +progressive_web_app/orientation=0 +progressive_web_app/icon_144x144="" +progressive_web_app/icon_180x180="" +progressive_web_app/icon_512x512="" +progressive_web_app/background_color=Color(0, 0, 0, 1) +dotnet/include_scripts_content=false +dotnet/include_debug_symbols=true +dotnet/embed_build_outputs=false + +[preset.2] + +name="Windows Desktop" +platform="Windows Desktop" +runnable=true +advanced_options=true +dedicated_server=false +custom_features="" +export_filter="scenes" +export_files=PackedStringArray("res://controller_test.tscn") +include_filter="" +exclude_filter="" +export_path="Builds/browser-testing.exe" +patches=PackedStringArray() +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=1 + +[preset.2.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=true +texture_format/s3tc_bptc=true +texture_format/etc2_astc=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=false +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 +application/export_d3d12=1 +application/d3d12_agility_sdk_multiarch=true +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 -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries +$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/icon.svg b/icon.svg new file mode 100644 index 0000000..9d8b7fa --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..cd2d0a8 --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://w0kk4slm5tek" +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/project.godot b/project.godot new file mode 100644 index 0000000..63de652 --- /dev/null +++ b/project.godot @@ -0,0 +1,59 @@ +; 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="browser-testing" +run/main_scene="uid://c63y7xw8m20dt" +config/features=PackedStringArray("4.4", "GL Compatibility") +run/max_fps=60 +run/low_processor_mode=true +config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=1600 +window/size/viewport_height=900 + +[dotnet] + +project/assembly_name="browser-testing" + +[input] + +move_left={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null) +] +} +move_right={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null) +] +} +move_up={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null) +] +} +move_down={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null) +] +} + +[rendering] + +renderer/rendering_method="gl_compatibility" +renderer/rendering_method.mobile="gl_compatibility"