Added touchscreen controls!
This commit is contained in:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user