freettrpg/testing/test/player.tscn
2024-06-18 18:58:47 +02:00

41 lines
1.9 KiB
Text

[gd_scene load_steps=4 format=3 uid="uid://dv67vdgb4h44q"]
# External resource for the player texture
[ext_resource type="Texture2D" uid="uid://dheqglouhkis6" path="res://testing/testAssets/player.png" id="1_cujcj"]
# External resource for the player script
[ext_resource type="Script" path="res://scripts/player.gd" id="1_oik63"]
# Sub-resource for the collision shape of the player
[sub_resource type="RectangleShape2D" id="RectangleShape2D_kf6qt"]
size = Vector2(20, 18) # Setting the size of the RectangleShape2D
# Root node of the scene, a CharacterBody2D named "player"
[node name="player" type="CharacterBody2D"]
script = ExtResource("1_oik63") # Assigning the external script to the player node
# Child node of the player, a Sprite2D named "sprite"
[node name="sprite" type="Sprite2D" parent="."]
texture = ExtResource("1_cujcj") # Assigning the external texture to the sprite node
# Child node of the player, a CollisionShape2D named "CollisionShape2D"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_kf6qt") # Assigning the rectangle shape as the collision shape
# Child node of the player, a Camera2D named "camera"
[node name="camera" type="Camera2D" parent="."]
enabled = false # Camera is initially disabled
# Child node of the player, a Button named "stats"
[node name="stats" type="Button" parent="."]
visible = false # Button is initially invisible
offset_left = 112.0 # Left offset of the button
offset_top = 152.0 # Top offset of the button
offset_right = 238.0 # Right offset of the button
offset_bottom = 187.0 # Bottom offset of the button
scale = Vector2(2, 2) # Scaling the button by a factor of 2
disabled = true # Button is initially disabled
text = "Stats" # Text displayed on the button
# Connecting the "pressed" signal of the "stats" button to the "_on_stats_pressed" method in the current node
[connection signal="pressed" from="stats" to="." method="_on_stats_pressed"]