From 99e5b496918ebfec139a2e0b0613d3d6408f4065 Mon Sep 17 00:00:00 2001 From: cutekibry Date: Sat, 10 Feb 2024 15:46:46 +0800 Subject: [PATCH] =?UTF-8?q?refactor(card=5Fbase):=20=E5=88=86=E7=A6=BB?= =?UTF-8?q?=E9=AB=98=E4=BA=AE=E5=92=8C=E4=B8=8D=E5=8F=AF=E7=94=A8=E7=9A=84?= =?UTF-8?q?=20sprite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 将 card_base_highlighted.png 修改为仅包含高亮不包含背景色的 card_base_highlight_border.png * 将原先的 AnimatedSprite2D 场景分离为 DisabledSprite、HighlightSprite 和 CardBaseSprite --- objects/card_base/card_base.tscn | 25 +++++++++--------- .../card_base/card_base_highlight_border.png | Bin 0 -> 230 bytes ... => card_base_highlight_border.png.import} | 8 +++--- objects/card_base/card_base_highlighted.png | Bin 296 -> 0 bytes 4 files changed, 16 insertions(+), 17 deletions(-) create mode 100644 objects/card_base/card_base_highlight_border.png rename objects/card_base/{card_base_highlighted.png.import => card_base_highlight_border.png.import} (63%) delete mode 100644 objects/card_base/card_base_highlighted.png diff --git a/objects/card_base/card_base.tscn b/objects/card_base/card_base.tscn index 1bdbd1b..e02c82e 100644 --- a/objects/card_base/card_base.tscn +++ b/objects/card_base/card_base.tscn @@ -5,7 +5,7 @@ [ext_resource type="FontFile" uid="uid://1000owdyvwfg" path="res://fonts/unifont-15.1.04.otf" id="3_0qykx"] [ext_resource type="Texture2D" uid="uid://b5d2rfms7vyfi" path="res://objects/card_base/card_base1.png" id="3_h7i1h"] [ext_resource type="Texture2D" uid="uid://bkjbrw1ppac5q" path="res://objects/card_base/card_base_disabled.png" id="4_0unxr"] -[ext_resource type="Texture2D" uid="uid://cs7vfmsrhpomj" path="res://objects/card_base/card_base_highlighted.png" id="5_tkdj2"] +[ext_resource type="Texture2D" uid="uid://bkuwo3g8pyuyi" path="res://objects/card_base/card_base_highlight_border.png" id="5_r41oe"] [ext_resource type="AudioStream" uid="uid://0sefo32v1jne" path="res://objects/card_base/pick_up.wav" id="7_0c7kt"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_2cmwb"] @@ -28,14 +28,6 @@ animations = [{ "loop": true, "name": &"disabled", "speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": ExtResource("5_tkdj2") -}], -"loop": true, -"name": &"highlighted", -"speed": 5.0 }] [node name="CardBase" type="Area2D"] @@ -45,10 +37,20 @@ script = ExtResource("1_k5qn1") shape = SubResource("RectangleShape2D_2cmwb") debug_color = Color(0.65098, 0.431373, 0.756863, 0.419608) +[node name="CardBaseSprite" type="AnimatedSprite2D" parent="."] +sprite_frames = SubResource("SpriteFrames_bhb3x") + [node name="Word" parent="." instance=ExtResource("2_jvsp3")] -z_index = 1 frame_progress = 0.953211 +[node name="HighlightSprite" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("5_r41oe") + +[node name="DisabledSprite" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("4_0unxr") + [node name="Label" type="Label" parent="."] offset_left = -13.0 offset_top = 17.0 @@ -59,9 +61,6 @@ text = "0" horizontal_alignment = 1 vertical_alignment = 1 -[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] -sprite_frames = SubResource("SpriteFrames_bhb3x") - [node name="Cards" type="Node" parent="."] [node name="FadeTimer" type="Timer" parent="."] diff --git a/objects/card_base/card_base_highlight_border.png b/objects/card_base/card_base_highlight_border.png new file mode 100644 index 0000000000000000000000000000000000000000..19ad568e3664d94166295e04b43a5226525c6231 GIT binary patch literal 230 zcmVPx#ph-kQR9J=Wm$4GSAP7UX|NqbF)H{u!cnV#}s6rmJ1C)~LRaXxH;EGYLQ!n-M z7QkSr0EveTv8rYzOTOWt4LSwb0eZBc+YnODu4whb0c7SScElS(@=!lbqyXSo5Yx{Z ztps5u2rEHY3BpPcR)VlZ5U;`63=%OAnLt`abVZ$6H3+XxeLm)y)uTH@vD*Po%a$o= g#QM2ao##US0yXYbG{X&;Z2$lO07*qoM6N<$g7Z9B@c;k- literal 0 HcmV?d00001 diff --git a/objects/card_base/card_base_highlighted.png.import b/objects/card_base/card_base_highlight_border.png.import similarity index 63% rename from objects/card_base/card_base_highlighted.png.import rename to objects/card_base/card_base_highlight_border.png.import index 5c5565a..5de750e 100644 --- a/objects/card_base/card_base_highlighted.png.import +++ b/objects/card_base/card_base_highlight_border.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cs7vfmsrhpomj" -path="res://.godot/imported/card_base_highlighted.png-50d4af98046c8a87d73d61ca6664f89e.ctex" +uid="uid://bkuwo3g8pyuyi" +path="res://.godot/imported/card_base_highlight_border.png-02641e6f6e23a694917134adadde948a.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://objects/card_base/card_base_highlighted.png" -dest_files=["res://.godot/imported/card_base_highlighted.png-50d4af98046c8a87d73d61ca6664f89e.ctex"] +source_file="res://objects/card_base/card_base_highlight_border.png" +dest_files=["res://.godot/imported/card_base_highlight_border.png-02641e6f6e23a694917134adadde948a.ctex"] [params] diff --git a/objects/card_base/card_base_highlighted.png b/objects/card_base/card_base_highlighted.png deleted file mode 100644 index 6213968765537dcf0591673a3d507e4fefa444b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 296 zcmV+@0oVSCP)Px#;z>k7R9J=WmoW~)FbqZQijmuJ6ok~FJ2T=O6?1onN)<=pHtc3fWt_Nal^7WO zrYcG6mmgJf0Gv-Sw}6PKN+HC>TIysifvBJ&lpK^2x5ulf_~p3I%0vTPqEujuP@}z6 zTO##MzUfAru%c^w=-NK2nM}kYjlkh_o`pE-(R>pkqMwTJRQ@6n02hgI5s8aPTtwm` z5*LvqMPy4?ljk(#MRF~_CF;>wq$1O}kJtHmCl@0khCVXLl(vrAaqya}FIck2EQP1B uC}JhV1%d>?io0)0rWQPiO@E2yh5QZIJ6S|><|Tgs0000J(