diff options
author | tpart <tpart120@proton.me> | 2024-07-21 17:21:07 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-07-21 17:21:07 +0200 |
commit | 2c07c62ebfe65527e9b2ba0c0773a6832f5aab22 (patch) | |
tree | 3a83bf334f1cda6eab2791ba6c084a07e5f0f4c3 | |
parent | df7bf7e1302538e5d429331c270017f9768293c7 (diff) | |
download | hurrycurry-2c07c62ebfe65527e9b2ba0c0773a6832f5aab22.tar hurrycurry-2c07c62ebfe65527e9b2ba0c0773a6832f5aab22.tar.bz2 hurrycurry-2c07c62ebfe65527e9b2ba0c0773a6832f5aab22.tar.zst |
Fix particle scaling
-rw-r--r-- | client/menu/rating/rating.gd | 5 | ||||
-rw-r--r-- | client/menu/rating/rating.tscn | 38 |
2 files changed, 27 insertions, 16 deletions
diff --git a/client/menu/rating/rating.gd b/client/menu/rating/rating.gd index faa0ba59..a3b2261d 100644 --- a/client/menu/rating/rating.gd +++ b/client/menu/rating/rating.gd @@ -6,12 +6,15 @@ const PARTICLE_AMOUNTS = [0, 6, 32, 128] @onready var subtitle: Label = $MarginContainer/PanelContainer/VBoxContainer/Text/Subtitle @onready var stars = $MarginContainer/PanelContainer/VBoxContainer/Stars.get_children() @onready var star_timer = $StarTimer -@onready var particles = $MarginContainer/PanelContainer/Particles +@onready var particles = $Control/Particles func _ready(): super() show_rating(data[0], data[1]) +func _process(delta): + particles.emission_rect_extents = get_viewport_rect().size * Vector2(0.5, 0.5) + func show_rating(stars_: int, points: int): match stars_: 0: title.text = tr("Poor service") diff --git a/client/menu/rating/rating.tscn b/client/menu/rating/rating.tscn index 8dbe50dd..a6594633 100644 --- a/client/menu/rating/rating.tscn +++ b/client/menu/rating/rating.tscn @@ -37,25 +37,17 @@ grow_vertical = 2 theme = ExtResource("1_uwajf") script = ExtResource("2_cq0se") -[node name="MarginContainer" type="MarginContainer" parent="."] +[node name="Control" type="Control" parent="."] layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 grow_horizontal = 2 grow_vertical = 2 -theme_override_constants/margin_left = 128 -theme_override_constants/margin_top = 64 -theme_override_constants/margin_right = 128 -theme_override_constants/margin_bottom = 64 -[node name="PanelContainer" type="PanelContainer" parent="MarginContainer"] -material = ExtResource("4_hdurb") -layout_mode = 2 - -[node name="Particles" type="CPUParticles2D" parent="MarginContainer/PanelContainer"] -position = Vector2(544, 292) -emitting = false +[node name="Particles" type="CPUParticles2D" parent="Control"] amount = 32 texture = ExtResource("1_7qv7r") emission_shape = 3 @@ -72,6 +64,22 @@ scale_amount_max = 0.2 scale_amount_curve = SubResource("Curve_dqga7") color_ramp = SubResource("Gradient_majwe") +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 128 +theme_override_constants/margin_top = 64 +theme_override_constants/margin_right = 128 +theme_override_constants/margin_bottom = 64 + +[node name="PanelContainer" type="PanelContainer" parent="MarginContainer"] +material = ExtResource("4_hdurb") +layout_mode = 2 + [node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/PanelContainer"] layout_mode = 2 theme_override_constants/separation = 64 |