Skip to content

Commit

Permalink
adding three buttons for touch screen uing control ui node and a few …
Browse files Browse the repository at this point in the history
…button nodes
  • Loading branch information
jbourqueendless committed Dec 2, 2024
1 parent 03c5535 commit f2b3c4b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 40 deletions.
43 changes: 4 additions & 39 deletions main.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=18 format=3 uid="uid://dhcpt1kt8cs0g"]
[gd_scene load_steps=15 format=3 uid="uid://dhcpt1kt8cs0g"]

[ext_resource type="PackedScene" uid="uid://8st4scqt06l8" path="res://components/player/player.tscn" id="2_7yl00"]
[ext_resource type="PackedScene" uid="uid://jnrusvm3gric" path="res://spaces/background.tscn" id="2_tb5a2"]
Expand All @@ -13,10 +13,7 @@
[ext_resource type="SpriteFrames" uid="uid://bo581k1esb50n" path="res://components/player/spriteframes-red.tres" id="9_qmofe"]
[ext_resource type="PackedScene" uid="uid://beuisy5yrw0bq" path="res://components/flag/flag.tscn" id="12_dkbog"]
[ext_resource type="Script" path="res://scripts/multiplayer_camera.gd" id="13_0d2mj"]
[ext_resource type="Texture2D" uid="uid://dnq46nmf2skjg" path="res://assets/Touchscreen Controls/kenney_onscreen-controls/Sprites/flat-light/flatLight22.png" id="14_5ab13"]
[ext_resource type="Texture2D" uid="uid://cbieuf3n6iqko" path="res://assets/Touchscreen Controls/kenney_onscreen-controls/Sprites/flat-light/flatLight25.png" id="14_g23fj"]
[ext_resource type="Texture2D" uid="uid://dsght3iwomray" path="res://assets/Touchscreen Controls/kenney_onscreen-controls/Sprites/flat-light/flatLight23.png" id="15_twkht"]
[ext_resource type="Texture2D" uid="uid://djok3hg16clb2" path="res://assets/Touchscreen Controls/kenney_onscreen-controls/Sprites/flat-light/flatLight24.png" id="16_cmlt1"]
[ext_resource type="PackedScene" uid="uid://dhu8h331t4p0o" path="res://touch_screen_controls.tscn" id="14_3oook"]

[node name="Main" type="Node2D"]

Expand Down Expand Up @@ -237,37 +234,5 @@ script = ExtResource("13_0d2mj")

[node name="CanvasLayer" type="CanvasLayer" parent="."]

[node name="Control" type="Control" parent="CanvasLayer"]
layout_mode = 3
anchor_left = 0.041
anchor_top = 0.656
anchor_right = 0.262
anchor_bottom = 1.006
offset_left = 37.28
offset_top = 5.51996
offset_right = 37.96
offset_bottom = 4.5199

[node name="MoveDownButton" type="TouchScreenButton" parent="CanvasLayer/Control"]
position = Vector2(127, 221)
scale = Vector2(1.775, 1.8625)
texture_normal = ExtResource("14_g23fj")
action = "player_1_left"

[node name="MoveRightButton" type="TouchScreenButton" parent="CanvasLayer/Control"]
position = Vector2(250, 93)
scale = Vector2(1.775, 1.8625)
texture_normal = ExtResource("15_twkht")
action = "player_1_left"

[node name="MoveUpButton" type="TouchScreenButton" parent="CanvasLayer/Control"]
position = Vector2(120, -20)
scale = Vector2(1.775, 1.8625)
texture_normal = ExtResource("16_cmlt1")
action = "player_1_left"

[node name="MoveLeftButton4" type="TouchScreenButton" parent="CanvasLayer/Control"]
position = Vector2(-4, 101)
scale = Vector2(1.775, 1.8625)
texture_normal = ExtResource("14_5ab13")
action = "player_1_left"
[node name="TouchScreenControls" parent="CanvasLayer" instance=ExtResource("14_3oook")]
anchors_preset = 15
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ window/stretch/mode="canvas_items"

[editor_plugins]

enabled=PackedStringArray("res://addons/block_code/plugin.cfg")
enabled=PackedStringArray()

[global_group]

Expand Down
30 changes: 30 additions & 0 deletions touch_screen_controls.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[gd_scene load_steps=4 format=3 uid="uid://dhu8h331t4p0o"]

[ext_resource type="Texture2D" uid="uid://dnq46nmf2skjg" path="res://assets/Touchscreen Controls/kenney_onscreen-controls/Sprites/flat-light/flatLight22.png" id="1_o68br"]
[ext_resource type="Texture2D" uid="uid://dsght3iwomray" path="res://assets/Touchscreen Controls/kenney_onscreen-controls/Sprites/flat-light/flatLight23.png" id="2_d4mmb"]
[ext_resource type="Texture2D" uid="uid://crocudarwwiec" path="res://assets/Touchscreen Controls/kenney_onscreen-controls/Sprites/flat-light/flatLight34.png" id="3_mqvem"]

[node name="TouchScreenControls" type="Control"]
layout_mode = 3
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="MovePlayerLeft" type="TouchScreenButton" parent="."]
position = Vector2(79.4, 844.84)
scale = Vector2(2, 1.964)
texture_normal = ExtResource("1_o68br")
action = "player_1_left"

[node name="MovePlayerRight" type="TouchScreenButton" parent="."]
position = Vector2(342.16, 844.84)
scale = Vector2(2, 2)
texture_normal = ExtResource("2_d4mmb")
action = "player_1_right"

[node name="Jump" type="TouchScreenButton" parent="."]
position = Vector2(1695, 837)
scale = Vector2(2, 2)
texture_normal = ExtResource("3_mqvem")
action = "player_1_jump"

0 comments on commit f2b3c4b

Please sign in to comment.