Add tooltip component and integrate it into the scene; adjust audio volume for coin sound effect

This commit is contained in:
2025-05-03 04:34:31 +02:00
parent 8c9afeee27
commit 17387c32ea
8 changed files with 144 additions and 7 deletions

View File

@@ -0,0 +1,10 @@
[gd_scene load_steps=2 format=3 uid="uid://dwi23csqy6d6m"]
[ext_resource type="AudioStream" uid="uid://bludculi5i6s" path="res://music/Cute RPG - Dreamy Dandelion (Loopable).ogg" id="1_fuc3i"]
[node name="AudioController" type="Node"]
[node name="Background Music" type="AudioStreamPlayer" parent="."]
stream = ExtResource("1_fuc3i")
autoplay = true
parameters/looping = true

View File

@@ -37,4 +37,4 @@ area2d = NodePath("..")
[node name="sfx" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_4jc2c")
volume_db = -5.0
volume_db = -10.0

54
objects/tooltip.tscn Normal file
View File

@@ -0,0 +1,54 @@
[gd_scene load_steps=5 format=3 uid="uid://b4pdt1gv2ymyi"]
[ext_resource type="Script" path="res://scripts/components/tooltip_component.gd" id="1_kkpqq"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_yy7uq"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_hkd8b"]
size = Vector2(12, 17)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_lqw6h"]
bg_color = Color(0, 0, 0, 1)
[node name="Tooltip" type="Area2D" node_paths=PackedStringArray("area2d", "ui_root", "tooltip_label")]
collision_layer = 0
collision_mask = 4
script = ExtResource("1_kkpqq")
area2d = NodePath(".")
ui_root = NodePath("Panel")
tooltip_label = NodePath("Panel/PanelContainer/Label")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -0.5)
shape = SubResource("RectangleShape2D_hkd8b")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_yy7uq")
hframes = 12
vframes = 12
frame = 53
[node name="Panel" type="Panel" parent="."]
offset_left = -66.0
offset_top = -59.0
offset_right = 67.0
offset_bottom = -14.0
theme_override_styles/panel = SubResource("StyleBoxFlat_lqw6h")
metadata/_edit_group_ = true
[node name="PanelContainer" type="PanelContainer" parent="Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Label" type="Label" parent="Panel/PanelContainer"]
custom_minimum_size = Vector2(32, 8)
layout_mode = 2
size_flags_vertical = 1
theme_override_font_sizes/font_size = 8
horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 3
clip_text = true