diff --git a/core/main_scene_ui/assets/audio_player_background.png b/core/main_scene_ui/assets/audio_player_background.png new file mode 100644 index 0000000..35786d9 Binary files /dev/null and b/core/main_scene_ui/assets/audio_player_background.png differ diff --git a/core/main_scene_ui/assets/audio_player_background.png.import b/core/main_scene_ui/assets/audio_player_background.png.import new file mode 100644 index 0000000..a447ccf --- /dev/null +++ b/core/main_scene_ui/assets/audio_player_background.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dlp62v48tori0" +path="res://.godot/imported/audio_player_background.png-1675fa2e75631748d14a166a21ea483f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://core/main_scene_ui/assets/audio_player_background.png" +dest_files=["res://.godot/imported/audio_player_background.png-1675fa2e75631748d14a166a21ea483f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/core/main_scene_ui/audio_player.gd b/core/main_scene_ui/audio_player.gd index b8f9c95..b18e1d9 100644 --- a/core/main_scene_ui/audio_player.gd +++ b/core/main_scene_ui/audio_player.gd @@ -13,6 +13,7 @@ extends Control @onready var decrease_volume_button: Button = $%DecreaseVolumeButton @onready var left_wheel: TextureRect = $%LeftWheel @onready var right_wheel: TextureRect = $%RightWheel +@onready var background: TextureRect = $%Background func _ready() -> void: prev_track_button.pressed.connect(_on_prev_track_button_pressed) @@ -49,11 +50,11 @@ func _on_radio_track_changed(track_name: String) -> void: track_label.text = track_name func _play_button_tween() -> void: - TweenFX.stop_all(self) - scale = Vector2.ONE - rotation = 0.0 - modulate.a = 1.0 - TweenFX.press_rotate(self) + TweenFX.stop_all(background) + background.scale = Vector2.ONE + background.rotation = 0.0 + background.modulate.a = 1.0 + TweenFX.press_rotate(background) func _on_prev_track_button_pressed() -> void: if radio: diff --git a/core/main_scene_ui/audio_player.tscn b/core/main_scene_ui/audio_player.tscn index b021451..3b7da0f 100644 --- a/core/main_scene_ui/audio_player.tscn +++ b/core/main_scene_ui/audio_player.tscn @@ -2,6 +2,7 @@ [ext_resource type="Script" uid="uid://c4kekqicrv4m8" path="res://core/main_scene_ui/audio_player.gd" id="1_i2mrl"] [ext_resource type="Theme" uid="uid://bg8megpn77mod" path="res://core/font/main_theme.tres" id="2_0koyu"] +[ext_resource type="Texture2D" uid="uid://dlp62v48tori0" path="res://core/main_scene_ui/assets/audio_player_background.png" id="3_e87kc"] [ext_resource type="Texture2D" uid="uid://s8pp2i6bjkps" path="res://core/main_scene_ui/assets/audio_player_wheel.png" id="4_n5r1o"] [ext_resource type="Texture2D" uid="uid://bgrmy57xhg2gj" path="res://core/main_scene_ui/assets/audio_player_empty.png" id="10_xv7rp"] @@ -23,11 +24,63 @@ layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 pivot_offset_ratio = Vector2(0.5, 0.5) mouse_filter = 2 texture = ExtResource("10_xv7rp") metadata/_edit_use_anchors_ = true +[node name="Background" type="TextureRect" parent="." unique_id=1772744681] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +pivot_offset_ratio = Vector2(0.5, 0.5) +mouse_filter = 2 +texture = ExtResource("3_e87kc") +stretch_mode = 2 +metadata/_edit_use_anchors_ = true + +[node name="LeftWheel" type="TextureRect" parent="Background" unique_id=1719200441] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -51.5 +offset_top = -47.5 +offset_right = -20.5 +offset_bottom = -16.5 +grow_horizontal = 2 +grow_vertical = 2 +pivot_offset_ratio = Vector2(0.5, 0.5) +texture = ExtResource("4_n5r1o") +stretch_mode = 2 + +[node name="RightWheel" type="TextureRect" parent="Background" unique_id=960520776] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = 18.5 +offset_top = -47.5 +offset_right = 49.5 +offset_bottom = -16.5 +grow_horizontal = 2 +grow_vertical = 2 +pivot_offset_ratio = Vector2(0.5, 0.5) +texture = ExtResource("4_n5r1o") +stretch_mode = 2 + [node name="DisplayContainer" type="Control" parent="." unique_id=1280352652] clip_contents = true layout_mode = 1 @@ -119,39 +172,3 @@ custom_minimum_size = Vector2(32, 0) layout_mode = 2 size_flags_horizontal = 5 flat = true - -[node name="LeftWheel" type="TextureRect" parent="." unique_id=1719200441] -unique_name_in_owner = true -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -64.5 -offset_top = -51.5 -offset_right = -33.5 -offset_bottom = -20.5 -grow_horizontal = 2 -grow_vertical = 2 -pivot_offset_ratio = Vector2(0.5, 0.5) -texture = ExtResource("4_n5r1o") -stretch_mode = 2 - -[node name="RightWheel" type="TextureRect" parent="." unique_id=960520776] -unique_name_in_owner = true -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = 35.5 -offset_top = -51.5 -offset_right = 66.5 -offset_bottom = -20.5 -grow_horizontal = 2 -grow_vertical = 2 -pivot_offset_ratio = Vector2(0.5, 0.5) -texture = ExtResource("4_n5r1o") -stretch_mode = 2