Skip to content

Commit

Permalink
refactor(card_base): 分离高亮和不可用的 sprite
Browse files Browse the repository at this point in the history
* 将 card_base_highlighted.png 修改为仅包含高亮不包含背景色的 card_base_highlight_border.png
* 将原先的 AnimatedSprite2D 场景分离为 DisabledSprite、HighlightSprite 和 CardBaseSprite
  • Loading branch information
cutekibry committed Feb 10, 2024
1 parent c7c8470 commit 99e5b49
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
25 changes: 12 additions & 13 deletions objects/card_base/card_base.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"]
Expand All @@ -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
Expand All @@ -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="."]
Expand Down
Binary file added objects/card_base/card_base_highlight_border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
Binary file removed objects/card_base/card_base_highlighted.png
Binary file not shown.

0 comments on commit 99e5b49

Please sign in to comment.