mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-27 22:12:29 +08:00
feat(技能图标): 改进冷却进度视觉效果和样式
- 移除进度值的clamp限制,允许超出范围效果 - 为冷却进度着色器添加边缘高光和拖尾效果 - 调整图标容器圆角和最小尺寸 - 更新材质参数以支持新的着色器效果
This commit is contained in:
@@ -10,18 +10,20 @@ content_margin_top = 5.0
|
|||||||
content_margin_right = 5.0
|
content_margin_right = 5.0
|
||||||
content_margin_bottom = 5.0
|
content_margin_bottom = 5.0
|
||||||
bg_color = Color(0, 0, 0, 0.5)
|
bg_color = Color(0, 0, 0, 0.5)
|
||||||
corner_radius_top_left = 15
|
corner_radius_top_left = 20
|
||||||
corner_radius_top_right = 15
|
corner_radius_top_right = 20
|
||||||
corner_radius_bottom_right = 15
|
corner_radius_bottom_right = 20
|
||||||
corner_radius_bottom_left = 15
|
corner_radius_bottom_left = 20
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ew32n"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ew32n"]
|
||||||
shader = ExtResource("1_jaivk")
|
shader = ExtResource("1_jaivk")
|
||||||
shader_parameter/progress = 0.5
|
shader_parameter/progress = 0.5
|
||||||
shader_parameter/backAlpha = 0.25
|
shader_parameter/backAlpha = 0.25
|
||||||
|
shader_parameter/edgeHeight = 0.05
|
||||||
|
shader_parameter/trailHeight = 0.3
|
||||||
|
|
||||||
[node name="SkillIconBase" type="PanelContainer"]
|
[node name="SkillIconBase" type="PanelContainer"]
|
||||||
custom_minimum_size = Vector2(30, 30)
|
custom_minimum_size = Vector2(40, 40)
|
||||||
offset_right = 30.0
|
offset_right = 30.0
|
||||||
offset_bottom = 30.0
|
offset_bottom = 30.0
|
||||||
theme_override_styles/panel = SubResource("StyleBoxFlat_a60wd")
|
theme_override_styles/panel = SubResource("StyleBoxFlat_a60wd")
|
||||||
|
|||||||
@@ -11,4 +11,4 @@ func _physics_process(_delta):
|
|||||||
if is_instance_valid(weapon):
|
if is_instance_valid(weapon):
|
||||||
textureRect.texture = weapon.avatarTexture
|
textureRect.texture = weapon.avatarTexture
|
||||||
var progress = weapon.cooldownTimer.timeSinceLastStart() / weapon.cooldownTimer.cooldown
|
var progress = weapon.cooldownTimer.timeSinceLastStart() / weapon.cooldownTimer.cooldown
|
||||||
textureRect.material.set_shader_parameter("progress", clamp(progress, 0, 1))
|
textureRect.material.set_shader_parameter("progress", progress)
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
shader_type canvas_item;
|
shader_type canvas_item;
|
||||||
uniform float progress:hint_range(0.0, 1.0, 0.01)=0.5;
|
uniform float progress:hint_range(0.0, 2.0, 0.01)=0.5;
|
||||||
uniform float backAlpha:hint_range(0.0, 1.0, 0.01)=0.25;
|
uniform float backAlpha:hint_range(0.0, 1.0, 0.01)=0.25;
|
||||||
|
uniform float edgeHeight:hint_range(0.0, 1.0, 0.01)=0.05;
|
||||||
|
uniform float trailHeight:hint_range(0.0, 1.0, 0.01)=0.3;
|
||||||
void fragment() {
|
void fragment() {
|
||||||
COLOR=texture(TEXTURE,UV);
|
COLOR=texture(TEXTURE,UV);
|
||||||
if(UV.y>=progress){
|
if(UV.y>=progress){
|
||||||
COLOR.a*=backAlpha;
|
COLOR.a*=backAlpha;
|
||||||
|
}else if(distance(UV.y,progress)<edgeHeight){
|
||||||
|
COLOR.rgb*=255.0;
|
||||||
|
}else if(progress-UV.y<=trailHeight){
|
||||||
|
COLOR.rgb*=1.0+(trailHeight/(progress-UV.y)-1.0)*0.5;
|
||||||
|
//COLOR.a*=(progress-UV.y)/trailHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user