Added touchscreen controls!

This commit is contained in:
2026-01-13 22:47:30 +01:00
parent 89a41397d1
commit 0c0998cd05
65 changed files with 1672 additions and 3270 deletions

View File

@@ -12,15 +12,6 @@ layer = 200
script = ExtResource("1_chat_ui")
[node name="ChatContainer" type="Control" parent="." unique_id=-1294967296]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 1
[node name="BottomLeft" type="MarginContainer" parent="ChatContainer" unique_id=-294967296]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
@@ -31,6 +22,16 @@ offset_right = 400.0
offset_bottom = -10.0
grow_horizontal = 0
grow_vertical = 0
mouse_filter = 1
[node name="BottomLeft" type="MarginContainer" parent="ChatContainer" unique_id=-294967296]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 1
[node name="Background" type="ColorRect" parent="ChatContainer/BottomLeft" unique_id=705032704]
visible = false
@@ -40,16 +41,21 @@ color = Color(0, 0, 0, 0.5)
[node name="VBox" type="VBoxContainer" parent="ChatContainer/BottomLeft" unique_id=1705032704]
layout_mode = 2
mouse_filter = 2
[node name="MessageScroll" type="ScrollContainer" parent="ChatContainer/BottomLeft/VBox" unique_id=-1589934592]
custom_minimum_size = Vector2(380, 150)
layout_mode = 2
size_flags_vertical = 3
mouse_filter = 1
scroll_horizontal_enabled = false
scroll_vertical_enabled = true
[node name="MessageList" type="VBoxContainer" parent="ChatContainer/BottomLeft/VBox/MessageScroll" unique_id=-589934592]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
mouse_filter = 1
[node name="ChatInput" type="LineEdit" parent="ChatContainer/BottomLeft/VBox" unique_id=1410065408]
visible = false

View File

@@ -4,7 +4,6 @@
[ext_resource type="PackedScene" uid="uid://cxfvw8y7jqn2p" path="res://scenes/player.tscn" id="2"]
[ext_resource type="Script" uid="uid://db58xcyo4cjk" path="res://scripts/game_world.gd" id="4"]
[ext_resource type="Script" uid="uid://wff5063ctp7g" path="res://scripts/debug_overlay.gd" id="5"]
[ext_resource type="Script" path="res://scripts/room_lighting_system.gd" id="6"]
[ext_resource type="AudioStream" uid="uid://dthr2w8x0cj6v" path="res://assets/audio/sfx/ambience/wind-castle-loop.wav.mp3" id="6_6c6v5"]
[ext_resource type="TileSet" uid="uid://dqem5tbvooxrg" path="res://assets/gfx/RPG DUNGEON VOL 3.tres" id="9"]
@@ -40,8 +39,5 @@ light_mask = 1048575
visibility_layer = 1048575
color = Color(0.4140625, 0.4140625, 0.4140625, 1)
[node name="RoomLightingSystem" type="Node2D" parent="." unique_id=1234567893]
script = ExtResource("6")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." unique_id=1141138343]
stream = ExtResource("6_6c6v5")

View File

@@ -3,7 +3,13 @@
[ext_resource type="Script" uid="uid://da5sp508nk1tx" path="res://scripts/ingame_hud.gd" id="1_hud_script"]
[ext_resource type="FontFile" uid="uid://bajcvmidrnc33" path="res://assets/fonts/standard_font.png" id="2_standard_font"]
[ext_resource type="Texture2D" uid="uid://dkisxs8ecfaul" path="res://assets/gfx/ui/hearts_filled.png" id="4_hearts_filled"]
[ext_resource type="Script" uid="uid://5hepk3l8u2eg" path="res://scripts/mobile_input.gd" id="5_44yxk"]
[ext_resource type="Script" uid="uid://dhn1uax7qtt1v" path="res://addons/virtual_joystick/virtual_joystick.gd" id="5_i0hld"]
[ext_resource type="Texture2D" uid="uid://dkpritx47nd4m" path="res://assets/gfx/pickups/items_n_shit.png" id="5_key_texture"]
[ext_resource type="Texture2D" uid="uid://01qhightlcso" path="res://addons/virtual_joystick/resources/textures/joystick_texture_5.png" id="6_yeruy"]
[ext_resource type="Texture2D" uid="uid://dywm4x5vqdtsm" path="res://addons/virtual_joystick/resources/textures/stick_texture_5.png" id="7_44yxk"]
[ext_resource type="Script" uid="uid://bh5a3ydiu51eo" path="res://addons/touchscreenbuttoncontrol/TouchScreenButtonControl.gd" id="8_cu5yl"]
[ext_resource type="StyleBox" uid="uid://cv5o175a2677e" path="res://addons/touchscreenbuttoncontrol/button_style.tres" id="8_yeruy"]
[sub_resource type="Theme" id="Theme_standard_font"]
default_font = ExtResource("2_standard_font")
@@ -15,6 +21,7 @@ region = Rect2(160, 208, 16, 16)
margin = Rect2(0, -2, 0, 0)
[node name="IngameHUD" type="CanvasLayer" unique_id=846985801]
layer = 201
script = ExtResource("1_hud_script")
[node name="UpperLeft" type="MarginContainer" parent="." unique_id=22752255]
@@ -128,3 +135,149 @@ horizontal_alignment = 1
[node name="TextureProgressBarBossHP" type="TextureProgressBar" parent="UpperRight/HBoxContainer/VBoxContainerBoss" unique_id=1266602557]
layout_mode = 2
texture_progress = ExtResource("4_hearts_filled")
[node name="MobileInput" type="Control" parent="." unique_id=1373461519]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 1
script = ExtResource("5_44yxk")
[node name="VirtualJoystick" type="Control" parent="MobileInput" unique_id=1151061008]
z_index = 4096
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 48.0
offset_top = -114.0
offset_right = 250.0
offset_bottom = 88.0
grow_vertical = 2
pivot_offset = Vector2(101, 101)
script = ExtResource("5_i0hld")
joystick_texture = ExtResource("6_yeruy")
joystick_opacity = 0.235
stick_texture = ExtResource("7_44yxk")
stick_opacity = 0.746
metadata/_custom_type_script = "uid://dhn1uax7qtt1v"
[node name="Control" type="Control" parent="MobileInput" unique_id=131649841]
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -40.0
offset_top = -20.0
offset_bottom = 20.0
grow_horizontal = 0
grow_vertical = 2
[node name="MarginContainer" type="MarginContainer" parent="MobileInput/Control" unique_id=710364056]
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -205.765
offset_top = -94.475
offset_right = -5.7649994
offset_bottom = 25.525024
grow_horizontal = 0
grow_vertical = 2
theme_override_constants/margin_right = 42
[node name="B_ButtonContainer" type="Control" parent="MobileInput/Control/MarginContainer" unique_id=297390115]
layout_mode = 2
[node name="B_Circle" type="Panel" parent="MobileInput/Control/MarginContainer/B_ButtonContainer" unique_id=2138926309]
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -32.0
offset_right = 64.0
offset_bottom = 32.0
grow_vertical = 2
theme_override_styles/panel = ExtResource("8_yeruy")
[node name="B_Label" type="Label" parent="MobileInput/Control/MarginContainer/B_ButtonContainer/B_Circle" unique_id=1440094044]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
text = "B"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TouchScreenButtonControl" type="TextureButton" parent="MobileInput/Control/MarginContainer/B_ButtonContainer/B_Circle" unique_id=1583063757]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
focus_mode = 0
mouse_filter = 2
action_mode = 0
ignore_texture_size = true
stretch_mode = 5
script = ExtResource("8_cu5yl")
touchscreen_only = true
input_action = "attack"
metadata/_custom_type_script = "uid://bh5a3ydiu51eo"
[node name="A_ButtonContainer" type="Control" parent="MobileInput/Control/MarginContainer" unique_id=1039434657]
layout_mode = 2
[node name="A_Circle" type="Panel" parent="MobileInput/Control/MarginContainer/A_ButtonContainer" unique_id=1415076009]
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -64.0
offset_top = -32.0
offset_bottom = 32.0
grow_horizontal = 0
grow_vertical = 2
theme_override_styles/panel = ExtResource("8_yeruy")
[node name="A_Label" type="Label" parent="MobileInput/Control/MarginContainer/A_ButtonContainer/A_Circle" unique_id=619215455]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
text = "A"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TouchScreenButtonControl" type="TextureButton" parent="MobileInput/Control/MarginContainer/A_ButtonContainer/A_Circle" unique_id=322194330]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
focus_mode = 0
mouse_filter = 2
action_mode = 0
ignore_texture_size = true
stretch_mode = 5
script = ExtResource("8_cu5yl")
touchscreen_only = true
input_action = "grab"
metadata/_custom_type_script = "uid://bh5a3ydiu51eo"
[connection signal="analogic_changed" from="MobileInput/VirtualJoystick" to="MobileInput" method="_on_virtual_joystick_analogic_changed"]

20
src/scenes/test.tscn Normal file
View File

@@ -0,0 +1,20 @@
[gd_scene format=3 uid="uid://o8cbi1whsbo0"]
[ext_resource type="Script" uid="uid://dhn1uax7qtt1v" path="res://addons/virtual_joystick/virtual_joystick.gd" id="1_iyx0m"]
[ext_resource type="Texture2D" uid="uid://01qhightlcso" path="res://addons/virtual_joystick/resources/textures/joystick_texture_5.png" id="2_74lek"]
[ext_resource type="Texture2D" uid="uid://dywm4x5vqdtsm" path="res://addons/virtual_joystick/resources/textures/stick_texture_5.png" id="3_j5jx5"]
[node name="Test" type="Node2D" unique_id=459289533]
[node name="VirtualJoystick" type="Control" parent="." unique_id=322625393]
layout_mode = 3
anchors_preset = 0
offset_left = 391.0
offset_top = 172.0
offset_right = 611.0
offset_bottom = 392.0
pivot_offset = Vector2(110, 110)
script = ExtResource("1_iyx0m")
joystick_texture = ExtResource("2_74lek")
stick_texture = ExtResource("3_j5jx5")
metadata/_custom_type_script = "uid://dhn1uax7qtt1v"