Add new UI components and functionality for member display
- Introduced a new image import for "陨落基围虾.jpg" to enhance visual assets. - Created a Pause panel script to manage UI state transitions. - Developed a Circle control for displaying avatars with customizable properties such as cyclotomy, colors, and border width. - Implemented a ThankMember script to dynamically update member information including name, avatar, and description.
@@ -0,0 +1,8 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bnf0o8rmin5v4"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b7vxserbhskol" path="res://resources/feeds/banana.svg" id="1_omrjh"]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_omrjh")
|
||||
@@ -1,20 +1,29 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://cksonrrx38k36"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://cksonrrx38k36"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://d3qojeqa3difn" path="res://components/Abstracts/FullscreenPanelBase.tscn" id="1_q0gd0"]
|
||||
[ext_resource type="Script" path="res://scripts/Contents/Panels/Pause.gd" id="2_lg6qs"]
|
||||
[ext_resource type="FontFile" uid="uid://db2jl4bq8idec" path="res://resources/fonts/swyc.ttf" id="2_rf3pp"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_17i5j"]
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_hsvpc"]
|
||||
font = ExtResource("2_rf3pp")
|
||||
font_size = 50
|
||||
|
||||
[node name="Pause" instance=ExtResource("1_q0gd0")]
|
||||
visible = false
|
||||
offset_top = 0.0
|
||||
offset_bottom = 0.0
|
||||
script = ExtResource("2_lg6qs")
|
||||
|
||||
[node name="wrapper" parent="content" index="0"]
|
||||
theme_override_constants/separation = 50
|
||||
[node name="wrapper" parent="content" index="1"]
|
||||
theme_override_constants/separation = 10
|
||||
|
||||
[node name="text" type="Label" parent="content/wrapper" index="0"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "已暂停"
|
||||
label_settings = SubResource("LabelSettings_17i5j")
|
||||
label_settings = SubResource("LabelSettings_hsvpc")
|
||||
|
||||
[node name="aboutBtn" type="Button" parent="content/wrapper" index="1"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "关于↗"
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://w2o3klbsssq3"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://d3qojeqa3difn" path="res://components/Abstracts/FullscreenPanelBase.tscn" id="1_p58cm"]
|
||||
[ext_resource type="PackedScene" uid="uid://hvbt4p0beker" path="res://components/UI/ThankMember.tscn" id="2_4m1jv"]
|
||||
[ext_resource type="Texture2D" uid="uid://okeih4pdjvt6" path="res://resources/members/灵阁.jpg" id="3_1sqi2"]
|
||||
[ext_resource type="Texture2D" uid="uid://dm737iaabyg0n" path="res://resources/members/主核.jpg" id="4_31aos"]
|
||||
[ext_resource type="Texture2D" uid="uid://h75rhrl8ixwf" path="res://resources/members/陨落基围虾.jpg" id="5_1ofw3"]
|
||||
|
||||
[node name="Thanks" instance=ExtResource("1_p58cm")]
|
||||
offset_top = 0.0
|
||||
offset_bottom = 0.0
|
||||
|
||||
[node name="wrapper" parent="content" index="1"]
|
||||
theme_override_constants/separation = 30
|
||||
|
||||
[node name="title" type="RichTextLabel" parent="content/wrapper" index="0"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
bbcode_enabled = true
|
||||
text = "[font_size=30][b]特别鸣谢[/b][/font_size]"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
|
||||
[node name="members" type="GridContainer" parent="content/wrapper" index="1"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/h_separation = 30
|
||||
theme_override_constants/v_separation = 30
|
||||
columns = 4
|
||||
|
||||
[node name="ling" parent="content/wrapper/members" index="0" instance=ExtResource("2_4m1jv")]
|
||||
layout_mode = 2
|
||||
memberName = "灵阁"
|
||||
memberAvatar = ExtResource("3_1sqi2")
|
||||
memberDescription = "技术交流群"
|
||||
|
||||
[node name="fs" parent="content/wrapper/members" index="1" instance=ExtResource("2_4m1jv")]
|
||||
layout_mode = 2
|
||||
memberName = "陨落基围虾"
|
||||
memberAvatar = ExtResource("5_1ofw3")
|
||||
memberDescription = "程序开发"
|
||||
|
||||
[node name="kernyr" parent="content/wrapper/members" index="2" instance=ExtResource("2_4m1jv")]
|
||||
layout_mode = 2
|
||||
memberName = "主核"
|
||||
memberAvatar = ExtResource("4_31aos")
|
||||
memberDescription = "艺术支持"
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=20 format=3 uid="uid://dfwg750a47ggx"]
|
||||
[gd_scene load_steps=21 format=3 uid="uid://dfwg750a47ggx"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ofpg5s3j7esv" path="res://components/UI/BossBar.tscn" id="1_2pe58"]
|
||||
[ext_resource type="Script" path="res://scripts/Statemachine/UIState.gd" id="1_f00a6"]
|
||||
@@ -13,6 +13,7 @@
|
||||
[ext_resource type="StyleBox" uid="uid://ddnjus87wwlm8" path="res://styleboxes/leftPanel.tres" id="11_67ghp"]
|
||||
[ext_resource type="PackedScene" uid="uid://cksonrrx38k36" path="res://components/Scenes/FullscreenPanels/Pause.tscn" id="12_jkm6o"]
|
||||
[ext_resource type="PackedScene" uid="uid://dekcqdhrjs07u" path="res://components/Scenes/FullscreenPanels/Weapon.tscn" id="13_bmc24"]
|
||||
[ext_resource type="PackedScene" uid="uid://w2o3klbsssq3" path="res://components/Scenes/FullscreenPanels/Thanks.tscn" id="14_gp8lx"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ri8gw"]
|
||||
content_margin_left = 20.0
|
||||
@@ -287,13 +288,24 @@ metadata/_edit_lock_ = true
|
||||
[node name="MakeFeed" parent="root/panels" instance=ExtResource("4_kkki3")]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
offset_top = 0.0
|
||||
offset_bottom = 0.0
|
||||
|
||||
[node name="GameOver" parent="root/panels" instance=ExtResource("6_10ay6")]
|
||||
layout_mode = 1
|
||||
offset_top = 0.0
|
||||
offset_bottom = 0.0
|
||||
|
||||
[node name="Pause" parent="root/panels" instance=ExtResource("12_jkm6o")]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
|
||||
[node name="Weapon" parent="root/panels" instance=ExtResource("13_bmc24")]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
offset_top = 0.0
|
||||
offset_bottom = 0.0
|
||||
|
||||
[node name="Thanks" parent="root/panels" instance=ExtResource("14_gp8lx")]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://c4ovgkhjpsc15"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/Statemachine/Circle.gd" id="1_6qqj4"]
|
||||
[ext_resource type="Texture2D" uid="uid://dwwpkn4q07ja2" path="res://icon.svg" id="2_jkqx1"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ueu7s"]
|
||||
bg_color = Color(0, 0, 0, 0.5)
|
||||
border_width_left = 5
|
||||
border_width_top = 5
|
||||
border_width_right = 5
|
||||
border_width_bottom = 5
|
||||
border_color = Color(0.2, 0.2, 0.2, 1)
|
||||
corner_radius_top_left = 50
|
||||
corner_radius_top_right = 50
|
||||
corner_radius_bottom_right = 50
|
||||
corner_radius_bottom_left = 50
|
||||
|
||||
[node name="CircleTextureRect" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 100.0
|
||||
offset_bottom = 100.0
|
||||
script = ExtResource("1_6qqj4")
|
||||
|
||||
[node name="background" type="PanelContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_right = 100.0
|
||||
offset_bottom = 100.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_ueu7s")
|
||||
|
||||
[node name="polygon" type="Polygon2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
clip_children = 1
|
||||
position = Vector2(50, 50)
|
||||
polygon = PackedVector2Array(45, 0, 44.1353, 8.77906, 41.5746, 17.2208, 37.4161, 25.0007, 31.8198, 31.8198, 25.0007, 37.4161, 17.2208, 41.5746, 8.77906, 44.1353, 2.75536e-15, 45, -8.77906, 44.1353, -17.2208, 41.5746, -25.0007, 37.4161, -31.8198, 31.8198, -37.4161, 25.0007, -41.5746, 17.2208, -44.1353, 8.77906, -45, 5.51073e-15, -44.1353, -8.77906, -41.5746, -17.2208, -37.4161, -25.0007, -31.8198, -31.8198, -25.0007, -37.4161, -17.2208, -41.5746, -8.77906, -44.1353, -8.26609e-15, -45, 8.77906, -44.1353, 17.2208, -41.5746, 25.0007, -37.4161, 31.8198, -31.8198, 37.4161, -25.0007, 41.5746, -17.2208, 44.1353, -8.77906)
|
||||
|
||||
[node name="texture" type="TextureRect" parent="polygon"]
|
||||
unique_name_in_owner = true
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -50.0
|
||||
offset_top = -50.0
|
||||
offset_right = 50.0
|
||||
offset_bottom = 50.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("2_jkqx1")
|
||||
expand_mode = 1
|
||||
@@ -0,0 +1,32 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://hvbt4p0beker"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c4ovgkhjpsc15" path="res://components/UI/CircleTextureRect.tscn" id="1_pdtwd"]
|
||||
[ext_resource type="Script" path="res://scripts/Statemachine/ThankMember.gd" id="1_tso8w"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_eced8"]
|
||||
font_size = 13
|
||||
|
||||
[node name="ThankMember" type="VBoxContainer"]
|
||||
offset_right = 80.0
|
||||
offset_bottom = 116.0
|
||||
script = ExtResource("1_tso8w")
|
||||
|
||||
[node name="avatar" parent="." instance=ExtResource("1_pdtwd")]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 0
|
||||
|
||||
[node name="name" type="Label" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "未命名成员"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="description" type="Label" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "未知描述"
|
||||
label_settings = SubResource("LabelSettings_eced8")
|
||||
horizontal_alignment = 1
|
||||
|
After Width: | Height: | Size: 264 KiB |
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bcfdvau061b11"
|
||||
path="res://.godot/imported/Cyberexplorer.jpg-c383e85b497fadcaf26bc3835606b1a9.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/members/Cyberexplorer.jpg"
|
||||
dest_files=["res://.godot/imported/Cyberexplorer.jpg-c383e85b497fadcaf26bc3835606b1a9.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
|
After Width: | Height: | Size: 69 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://7okabc2eluxe"
|
||||
path="res://.godot/imported/Lindor.jpg-97b2a0dd42e6d0a782a55b9d62703026.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/members/Lindor.jpg"
|
||||
dest_files=["res://.godot/imported/Lindor.jpg-97b2a0dd42e6d0a782a55b9d62703026.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
|
After Width: | Height: | Size: 29 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dabr3y7ofvnot"
|
||||
path="res://.godot/imported/TangDo158.jpg-91cc80bbc41cb5aa862bf97789046371.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/members/TangDo158.jpg"
|
||||
dest_files=["res://.godot/imported/TangDo158.jpg-91cc80bbc41cb5aa862bf97789046371.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
|
After Width: | Height: | Size: 45 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b1njftfb5p6o2"
|
||||
path="res://.godot/imported/Tin-Dunwi.jpg-5de7ab45d0bfaaf39e2df99121f5522e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/members/Tin-Dunwi.jpg"
|
||||
dest_files=["res://.godot/imported/Tin-Dunwi.jpg-5de7ab45d0bfaaf39e2df99121f5522e.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
|
After Width: | Height: | Size: 45 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dm737iaabyg0n"
|
||||
path="res://.godot/imported/主核.jpg-9f38df381b055cd59fe09b06e6b3f2a1.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/members/主核.jpg"
|
||||
dest_files=["res://.godot/imported/主核.jpg-9f38df381b055cd59fe09b06e6b3f2a1.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://okeih4pdjvt6"
|
||||
path="res://.godot/imported/灵阁.jpg-55251cc2eb1c79d437eb7de86f5ea848.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/members/灵阁.jpg"
|
||||
dest_files=["res://.godot/imported/灵阁.jpg-55251cc2eb1c79d437eb7de86f5ea848.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
|
After Width: | Height: | Size: 60 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://h75rhrl8ixwf"
|
||||
path="res://.godot/imported/陨落基围虾.jpg-e48c375a3fdd3a9355bb28cd8c059aac.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/members/陨落基围虾.jpg"
|
||||
dest_files=["res://.godot/imported/陨落基围虾.jpg-e48c375a3fdd3a9355bb28cd8c059aac.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
@@ -0,0 +1,10 @@
|
||||
@tool
|
||||
extends FullscreenPanelBase
|
||||
|
||||
@onready var aboutBtn: Button = $"%aboutBtn"
|
||||
|
||||
func _ready():
|
||||
aboutBtn.pressed.connect(
|
||||
func():
|
||||
UIState.setPanel("Thanks")
|
||||
)
|
||||
@@ -0,0 +1,47 @@
|
||||
@tool
|
||||
extends Control
|
||||
class_name Circle
|
||||
|
||||
@export var cyclotomy: int = 32
|
||||
@export var avatar: Texture2D = null
|
||||
@export var backgroundColor: Color = Color(0, 0, 0, 0.5)
|
||||
@export var borderColor: Color = Color(0.2, 0.2, 0.2)
|
||||
@export var borderWidth: int = 5
|
||||
|
||||
@onready var polygon: Polygon2D = $"%polygon"
|
||||
@onready var texture: TextureRect = $"%texture"
|
||||
@onready var background: PanelContainer = $"%background"
|
||||
|
||||
var backgroundBox: StyleBoxFlat = null
|
||||
|
||||
func _ready():
|
||||
backgroundBox = StyleBoxFlat.new()
|
||||
background.add_theme_stylebox_override("panel", backgroundBox)
|
||||
func _process(_delta):
|
||||
var radius = max(size.x, size.y) / 2
|
||||
size = Vector2(radius * 2, radius * 2)
|
||||
polygon.polygon = getPolygon(radius)
|
||||
polygon.position = size / 2
|
||||
backgroundBox.bg_color = backgroundColor
|
||||
backgroundBox.border_color = borderColor
|
||||
backgroundBox.corner_radius_top_left = radius
|
||||
backgroundBox.corner_radius_top_right = radius
|
||||
backgroundBox.corner_radius_bottom_left = radius
|
||||
backgroundBox.corner_radius_bottom_right = radius
|
||||
backgroundBox.border_width_top = borderWidth
|
||||
backgroundBox.border_width_bottom = borderWidth
|
||||
backgroundBox.border_width_left = borderWidth
|
||||
backgroundBox.border_width_right = borderWidth
|
||||
background.size = size
|
||||
texture.size = Vector2(radius * 2, radius * 2)
|
||||
texture.position = - Vector2(radius, radius)
|
||||
if avatar:
|
||||
texture.texture = avatar
|
||||
func getPolygon(radius: float):
|
||||
var result: Array[Vector2] = []
|
||||
for i in cyclotomy:
|
||||
var angle = i * (TAU / cyclotomy)
|
||||
var x = (radius - borderWidth) * cos(angle)
|
||||
var y = (radius - borderWidth) * sin(angle)
|
||||
result.append(Vector2(x, y))
|
||||
return result
|
||||
@@ -0,0 +1,15 @@
|
||||
@tool
|
||||
extends VBoxContainer
|
||||
|
||||
@export var memberName: String = "未命名成员"
|
||||
@export var memberAvatar: Texture2D = null
|
||||
@export var memberDescription: String = "未知描述"
|
||||
|
||||
@onready var avatar: Circle = $"%avatar"
|
||||
@onready var nameLabel: Label = $"%name"
|
||||
@onready var descriptionLabel: Label = $"%description"
|
||||
|
||||
func _process(_delta):
|
||||
nameLabel.text = memberName
|
||||
descriptionLabel.text = memberDescription
|
||||
avatar.avatar = memberAvatar
|
||||