Cambiados los aspectos visuales del juego a algo gotico
This commit is contained in:
1 parent
ec7e35ddf6
commit
967b3a286d
205 files changed
+7056
-1630
No files matched your search
@@ -0,0 +1,16 @@
|
||||
extends Control
|
||||
|
||||
## Mantiene las esquinas del marco a su proporcion original y despeja los controles.
|
||||
## Solo adapta la presentacion; las tres fracciones de vida siguen en el jefe.
|
||||
func _ready() -> void:
|
||||
get_viewport().size_changed.connect(_layout_frame)
|
||||
_layout_frame()
|
||||
|
||||
|
||||
func _layout_frame() -> void:
|
||||
var viewport_size: Vector2 = get_viewport_rect().size
|
||||
var factor: float = minf(1.0, maxf(0.2, (viewport_size.x - 48.0) / 880.0))
|
||||
size = Vector2(880.0, 140.0)
|
||||
scale = Vector2.ONE * factor
|
||||
position = Vector2(roundf((viewport_size.x - 880.0 * factor) * 0.5),
|
||||
roundf(viewport_size.y - 30.0 - 140.0 * factor))
|
||||
@@ -11,6 +11,8 @@ extends CanvasLayer
|
||||
@onready var health_label: Label = $HUD/HealthBar/HealthLabel
|
||||
@onready var effects_label: Label = $HUD/EffectsLabel
|
||||
@onready var warning_label: Label = $HUD/WarningLabel
|
||||
@onready var portrait: TextureRect = $HUD/Emblem
|
||||
@onready var identity_label: Label = $HUD/Title
|
||||
|
||||
var player_ref: Node
|
||||
var _received_health: bool = false
|
||||
@@ -27,6 +29,7 @@ func _ready() -> void:
|
||||
return
|
||||
# Los hijos ejecutan _ready antes que Player; su senal inicial llegara despues de esta conexion.
|
||||
player_ref.connect(&"health_changed", _on_health_changed)
|
||||
call_deferred("_update_identity")
|
||||
effects_label.visible = false
|
||||
# Tambien funciona si el HUD se instancia despues de _ready del jugador.
|
||||
if player_ref.is_node_ready():
|
||||
@@ -67,7 +70,7 @@ func _process(delta: float) -> void:
|
||||
]:
|
||||
var bonus: float = float(player_ref.get(effect[1]))
|
||||
if bonus > 0.0:
|
||||
active.append("%s +%d%% | HASTA GOLPE" % [effect[0], roundi(bonus * 100.0)])
|
||||
active.append("%s +%d%% HASTA GOLPE" % [effect[0], roundi(bonus * 100.0)])
|
||||
|
||||
var shield_hits: int = int(player_ref.get("_shield_hits"))
|
||||
if shield_hits > 0:
|
||||
@@ -88,3 +91,22 @@ func _on_health_changed(current_health: int, max_health: int) -> void:
|
||||
health_bar.highlighted = low_health and amount > 0
|
||||
warning_label.visible = low_health or amount == 0
|
||||
warning_label.text = "SIN VIDA" if amount == 0 else "PELIGRO"
|
||||
|
||||
|
||||
## Retrato derivado del arte del personaje seleccionado; no modifica su estado.
|
||||
func _update_identity() -> void:
|
||||
if not is_instance_valid(player_ref):
|
||||
return
|
||||
var data: CharacterData = player_ref.get("character_data") as CharacterData
|
||||
if data == null:
|
||||
return
|
||||
identity_label.text = data.display_name.to_upper()
|
||||
var portrait_path: String = "res://assets/ashen/portraits/%s.png" % data.id
|
||||
if ResourceLoader.exists(portrait_path, "Texture2D"):
|
||||
var source: Texture2D = load(portrait_path) as Texture2D
|
||||
var bust := AtlasTexture.new()
|
||||
bust.atlas = source
|
||||
bust.region = Rect2(20, 0, 88, 88)
|
||||
portrait.texture = bust
|
||||
elif data.sprite_frames != null and data.sprite_frames.has_animation(&"idle"):
|
||||
portrait.texture = data.sprite_frames.get_frame_texture(&"idle", 0)
|
||||
@@ -1,11 +1,28 @@
|
||||
[gd_scene load_steps=7 format=3]
|
||||
[gd_scene load_steps=8 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://ui/hud/player_health_hud.gd" id="1_hud"]
|
||||
[ext_resource type="Script" path="res://ui/editor_ui_visibility.gd" id="editor_ui_visibility"]
|
||||
[ext_resource type="Script" path="res://ui/hud/thrash_meter.gd" id="meter"]
|
||||
[ext_resource type="Theme" path="res://ui/hud/thrash_hud_theme.tres" id="theme"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ui/hud/thrash_plate.svg" id="plate"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ui/hud/thrash_skull.svg" id="skull"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/ui/hud_frame.png" id="frame"]
|
||||
|
||||
[sub_resource type="Shader" id="PortraitMask"]
|
||||
code = "shader_type canvas_item;
|
||||
render_mode unshaded;
|
||||
varying vec2 portrait_uv;
|
||||
void vertex() {
|
||||
portrait_uv = VERTEX / vec2(78.0,78.0);
|
||||
}
|
||||
void fragment() {
|
||||
vec2 p = portrait_uv * 2.0 - 1.0;
|
||||
if (dot(p,p) > 1.0) discard;
|
||||
vec4 source = texture(TEXTURE, UV);
|
||||
COLOR = vec4(mix(vec3(0.045,0.036,0.039), source.rgb, source.a), 1.0);
|
||||
}
|
||||
"
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="PortraitMaterial"]
|
||||
shader = SubResource("PortraitMask")
|
||||
|
||||
[node name="PlayerHealthHUD" type="CanvasLayer"]
|
||||
layer = 90
|
||||
@@ -24,84 +41,90 @@ grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
theme = ExtResource("theme")
|
||||
|
||||
[node name="Emblem" type="TextureRect" parent="HUD"]
|
||||
material = SubResource("PortraitMaterial")
|
||||
layout_mode = 0
|
||||
offset_left = 43.0
|
||||
offset_top = 44.0
|
||||
offset_right = 121.0
|
||||
offset_bottom = 122.0
|
||||
mouse_filter = 2
|
||||
texture_filter = 1
|
||||
expand_mode = 1
|
||||
stretch_mode = 0
|
||||
|
||||
[node name="HealthBar" type="ProgressBar" parent="HUD"]
|
||||
layout_mode = 0
|
||||
offset_left = 137.0
|
||||
offset_top = 68.0
|
||||
offset_right = 409.0
|
||||
offset_bottom = 88.0
|
||||
mouse_filter = 2
|
||||
max_value = 30.0
|
||||
value = 30.0
|
||||
show_percentage = false
|
||||
script = ExtResource("meter")
|
||||
fill_color = Color(0.62, 0.09, 0.16, 1)
|
||||
segment_count = 12
|
||||
|
||||
[node name="HealthLabel" type="Label" parent="HUD/HealthBar"]
|
||||
layout_mode = 0
|
||||
offset_left = 162.0
|
||||
offset_top = -32.0
|
||||
offset_right = 266.0
|
||||
offset_bottom = -10.0
|
||||
mouse_filter = 2
|
||||
theme_override_font_sizes/font_size = 16
|
||||
text = "30 / 30"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Frame" type="TextureRect" parent="HUD"]
|
||||
layout_mode = 0
|
||||
offset_left = 18.0
|
||||
offset_top = 18.0
|
||||
offset_right = 362.0
|
||||
offset_bottom = 82.0
|
||||
offset_top = 16.0
|
||||
offset_right = 450.0
|
||||
offset_bottom = 160.0
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("plate")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="Emblem" type="TextureRect" parent="HUD"]
|
||||
layout_mode = 0
|
||||
offset_left = 29.0
|
||||
offset_top = 26.0
|
||||
offset_right = 69.0
|
||||
offset_bottom = 66.0
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("skull")
|
||||
texture_filter = 1
|
||||
texture = ExtResource("frame")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="Title" type="Label" parent="HUD"]
|
||||
layout_mode = 0
|
||||
offset_left = 84.0
|
||||
offset_top = 25.0
|
||||
offset_right = 152.0
|
||||
offset_bottom = 45.0
|
||||
offset_left = 139.0
|
||||
offset_top = 36.0
|
||||
offset_right = 221.0
|
||||
offset_bottom = 54.0
|
||||
mouse_filter = 2
|
||||
theme_override_font_sizes/font_size = 16
|
||||
text = "VIDA"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="WarningLabel" type="Label" parent="HUD"]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_left = 154.0
|
||||
offset_top = 25.0
|
||||
offset_right = 212.0
|
||||
offset_bottom = 45.0
|
||||
offset_left = 249.0
|
||||
offset_top = 38.0
|
||||
offset_right = 313.0
|
||||
offset_bottom = 54.0
|
||||
mouse_filter = 2
|
||||
theme_override_colors/font_color = Color(1, 0.52, 0.42, 1)
|
||||
theme_override_colors/font_color = Color(0.98, 0.44, 0.36, 1)
|
||||
theme_override_font_sizes/font_size = 8
|
||||
text = "PELIGRO"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HealthBar" type="ProgressBar" parent="HUD"]
|
||||
layout_mode = 0
|
||||
offset_left = 84.0
|
||||
offset_top = 48.0
|
||||
offset_right = 346.0
|
||||
offset_bottom = 68.0
|
||||
mouse_filter = 2
|
||||
max_value = 50.0
|
||||
value = 50.0
|
||||
show_percentage = false
|
||||
script = ExtResource("meter")
|
||||
fill_color = Color(0.84, 0.18, 0.25, 1)
|
||||
segment_count = 12
|
||||
|
||||
[node name="HealthLabel" type="Label" parent="HUD/HealthBar"]
|
||||
layout_mode = 0
|
||||
offset_left = 132.0
|
||||
offset_top = -23.0
|
||||
offset_right = 262.0
|
||||
offset_bottom = -3.0
|
||||
mouse_filter = 2
|
||||
text = "50 / 50"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="EffectsLabel" type="Label" parent="HUD"]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_left = 22.0
|
||||
offset_top = 160.0
|
||||
offset_right = 362.0
|
||||
offset_bottom = 300.0
|
||||
offset_left = 34.0
|
||||
offset_top = 169.0
|
||||
offset_right = 420.0
|
||||
offset_bottom = 281.0
|
||||
mouse_filter = 2
|
||||
theme_override_colors/font_color = Color(0.85, 0.9, 0.64, 1)
|
||||
theme_override_colors/font_color = Color(0.79, 0.72, 0.57, 1)
|
||||
theme_override_font_sizes/font_size = 16
|
||||
text = ""
|
||||
horizontal_alignment = 0
|
||||
|
||||
@@ -48,4 +48,5 @@ func _on_special_charge_changed(current_charge: int, max_charge: int) -> void:
|
||||
status_label.text = "LISTO"
|
||||
else:
|
||||
status_label.text = "CARGANDO"
|
||||
status_label.add_theme_color_override("font_color", Color("e4f39a") if charged else Color("93a3a0"))
|
||||
status_label.visible = charged or not available
|
||||
status_label.add_theme_color_override("font_color", Color("c6ae78") if charged else Color("829795"))
|
||||
@@ -1,11 +1,9 @@
|
||||
[gd_scene load_steps=7 format=3]
|
||||
[gd_scene load_steps=5 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://ui/hud/special_charge_hud.gd" id="1_hud"]
|
||||
[ext_resource type="Script" path="res://ui/editor_ui_visibility.gd" id="editor_ui_visibility"]
|
||||
[ext_resource type="Script" path="res://ui/hud/thrash_meter.gd" id="meter"]
|
||||
[ext_resource type="Theme" path="res://ui/hud/thrash_hud_theme.tres" id="theme"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ui/hud/thrash_plate.svg" id="plate"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ui/hud/thrash_bolt.svg" id="bolt"]
|
||||
|
||||
[node name="SpecialChargeHUD" type="CanvasLayer"]
|
||||
layer = 95
|
||||
@@ -24,83 +22,67 @@ grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
theme = ExtResource("theme")
|
||||
|
||||
[node name="Frame" type="TextureRect" parent="HUD"]
|
||||
layout_mode = 0
|
||||
offset_left = 18.0
|
||||
offset_top = 86.0
|
||||
offset_right = 362.0
|
||||
offset_bottom = 150.0
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("plate")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="Emblem" type="TextureRect" parent="HUD"]
|
||||
layout_mode = 0
|
||||
offset_left = 29.0
|
||||
offset_top = 94.0
|
||||
offset_right = 69.0
|
||||
offset_bottom = 134.0
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("bolt")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="Title" type="Label" parent="HUD"]
|
||||
layout_mode = 0
|
||||
offset_left = 84.0
|
||||
offset_top = 93.0
|
||||
offset_right = 155.0
|
||||
offset_bottom = 113.0
|
||||
offset_left = 139.0
|
||||
offset_top = 118.0
|
||||
offset_right = 193.0
|
||||
offset_bottom = 136.0
|
||||
mouse_filter = 2
|
||||
theme_override_font_sizes/font_size = 16
|
||||
theme_override_colors/font_color = Color(0.72, 0.69, 0.55, 1)
|
||||
text = "SOLO"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="StatusLabel" type="Label" parent="HUD"]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_left = 158.0
|
||||
offset_top = 93.0
|
||||
offset_right = 270.0
|
||||
offset_bottom = 113.0
|
||||
offset_left = 222.0
|
||||
offset_top = 120.0
|
||||
offset_right = 321.0
|
||||
offset_bottom = 134.0
|
||||
mouse_filter = 2
|
||||
theme_override_colors/font_color = Color(0.57, 0.64, 0.63, 1)
|
||||
theme_override_colors/font_color = Color(0.52, 0.6, 0.59, 1)
|
||||
theme_override_font_sizes/font_size = 8
|
||||
text = "CARGANDO"
|
||||
horizontal_alignment = 1
|
||||
horizontal_alignment = 0
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="SpecialBar" type="ProgressBar" parent="HUD"]
|
||||
layout_mode = 0
|
||||
offset_left = 84.0
|
||||
offset_top = 116.0
|
||||
offset_right = 346.0
|
||||
offset_bottom = 134.0
|
||||
offset_left = 139.0
|
||||
offset_top = 102.0
|
||||
offset_right = 373.0
|
||||
offset_bottom = 112.0
|
||||
mouse_filter = 2
|
||||
max_value = 100.0
|
||||
value = 0.0
|
||||
show_percentage = false
|
||||
script = ExtResource("meter")
|
||||
fill_color = Color(0.74, 0.89, 0.27, 1)
|
||||
fill_color = Color(0.25, 0.54, 0.57, 1)
|
||||
segment_count = 16
|
||||
activation_ratio = 0.25
|
||||
show_damage_trail = false
|
||||
|
||||
[node name="SpecialLabel" type="Label" parent="HUD/SpecialBar"]
|
||||
layout_mode = 0
|
||||
offset_left = 192.0
|
||||
offset_top = -23.0
|
||||
offset_right = 262.0
|
||||
offset_bottom = -3.0
|
||||
offset_left = 182.0
|
||||
offset_top = 16.0
|
||||
offset_right = 234.0
|
||||
offset_bottom = 34.0
|
||||
mouse_filter = 2
|
||||
theme_override_font_sizes/font_size = 16
|
||||
text = "0%"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ThresholdLabel" type="Label" parent="HUD"]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_left = 84.0
|
||||
offset_top = 136.0
|
||||
offset_right = 244.0
|
||||
offset_bottom = 146.0
|
||||
offset_left = 139.0
|
||||
offset_top = 138.0
|
||||
offset_right = 373.0
|
||||
offset_bottom = 150.0
|
||||
mouse_filter = 2
|
||||
theme_override_colors/font_color = Color(0.66, 0.71, 0.64, 1)
|
||||
theme_override_font_sizes/font_size = 8
|
||||
text = "MIN 25 PT"
|
||||
@@ -7,9 +7,9 @@
|
||||
[resource]
|
||||
default_font = ExtResource("pixel_font")
|
||||
default_font_size = 16
|
||||
Label/colors/font_color = Color(0.91, 0.91, 0.82, 1)
|
||||
Label/colors/font_color = Color(0.86, 0.81, 0.68, 1)
|
||||
Label/colors/font_shadow_color = Color(0.02, 0.03, 0.04, 1)
|
||||
Label/constants/shadow_offset_x = 1
|
||||
Label/constants/shadow_offset_y = 1
|
||||
Label/constants/shadow_offset_x = 2
|
||||
Label/constants/shadow_offset_y = 2
|
||||
ProgressBar/styles/background = SubResource("EmptyBar")
|
||||
ProgressBar/styles/fill = SubResource("EmptyBar")
|
||||
+22
-43
@@ -3,11 +3,11 @@ class_name ThrashMeter
|
||||
extends ProgressBar
|
||||
|
||||
## Medidor visual compartido por vida y especial; no conoce al jugador ni modifica el combate.
|
||||
## Conserva el contrato de ProgressBar (value/max_value) y dibuja segmentos de amplificador.
|
||||
## Conserva el contrato de ProgressBar (value/max_value) y dibuja un deposito continuo de sangre o luz espectral.
|
||||
## Solo este componente visual se ejecuta en el editor; los controladores del HUD no son @tool.
|
||||
|
||||
@export_group("Thrash Appearance")
|
||||
## Color de los segmentos llenos. La escena de vida usa rojo y la de especial, verde acido.
|
||||
## Color de los segmentos llenos. La escena de vida usa carmesi y la de especial, turquesa espectral.
|
||||
@export var fill_color: Color = Color("d73949"):
|
||||
set(new_value):
|
||||
fill_color = new_value
|
||||
@@ -145,49 +145,28 @@ func _draw() -> void:
|
||||
if size.x < 8.0 or size.y < 6.0:
|
||||
return
|
||||
var shown: float = clampf(value / maxf(max_value, 1.0), 0.0, 1.0) if Engine.is_editor_hint() else _display_ratio
|
||||
var inner := Rect2(Vector2(2, 2), size - Vector2(4, 4))
|
||||
var count: int = maxi(segment_count, 1)
|
||||
var step_width: float = inner.size.x / float(count)
|
||||
var cell_width: float = maxf(step_width - 2.0, 1.0)
|
||||
draw_rect(Rect2(Vector2.ZERO, size), Color("05090b"))
|
||||
draw_rect(Rect2(Vector2.ZERO, size), Color("3b464b"), false, 1.0)
|
||||
for index: int in range(count):
|
||||
var cell := Rect2(inner.position + Vector2(float(index) * step_width, 0), Vector2(cell_width, inner.size.y))
|
||||
_draw_segment(cell, 1.0, Color("202b30"))
|
||||
if show_damage_trail and not Engine.is_editor_hint():
|
||||
_draw_segment(cell, clampf(_trail_ratio * count - index, 0.0, 1.0), Color("a99774"))
|
||||
var fraction: float = clampf(shown * count - index, 0.0, 1.0)
|
||||
_draw_segment(cell, fraction, fill_color)
|
||||
if fraction > 0.0:
|
||||
# Bisel iluminado y una linea de sombra dentro de cada segmento.
|
||||
var bevel: float = minf(3.0, cell.size.x * 0.25)
|
||||
var length: float = (cell.size.x - bevel) * fraction
|
||||
draw_line(cell.position + Vector2(bevel, 1), cell.position + Vector2(bevel + length, 1), fill_color.lightened(0.45), 1.0)
|
||||
draw_line(cell.position + Vector2(0, cell.size.y - 1), cell.position + Vector2(length, cell.size.y - 1), fill_color.darkened(0.4), 1.0)
|
||||
|
||||
var inner := Rect2(Vector2(1, 1), size - Vector2(2, 2))
|
||||
draw_rect(Rect2(Vector2.ZERO, size), Color("100e13"))
|
||||
draw_rect(inner, Color("21181e"))
|
||||
if show_damage_trail and not Engine.is_editor_hint() and _trail_ratio > shown:
|
||||
draw_rect(Rect2(inner.position, Vector2(floorf(inner.size.x * _trail_ratio), inner.size.y)), Color("b99874"))
|
||||
var filled_width: float = floorf(inner.size.x * shown)
|
||||
if filled_width > 0.0:
|
||||
var fill := Rect2(inner.position, Vector2(filled_width, inner.size.y))
|
||||
draw_rect(fill, fill_color.darkened(0.3))
|
||||
draw_rect(Rect2(fill.position, Vector2(filled_width, maxf(1.0, floorf(fill.size.y * 0.55)))), fill_color)
|
||||
draw_line(fill.position, fill.position + Vector2(filled_width, 0), fill_color.lightened(0.45), 1.0)
|
||||
draw_line(fill.position + Vector2(0, 2), fill.position + Vector2(filled_width, 2), fill_color.lightened(0.15), 1.0)
|
||||
# Pequenias incisiones de metal reflejan luz; el nivel de carga sigue continuo.
|
||||
for x: int in range(11, int(filled_width), 37):
|
||||
draw_rect(Rect2(Vector2(x, maxf(2.0, size.y - 4.0)), Vector2(2, 1)), fill_color.lightened(0.2))
|
||||
if activation_ratio >= 0.0:
|
||||
var marker_x: float = inner.position.x + inner.size.x * clampf(activation_ratio, 0.0, 1.0)
|
||||
draw_line(Vector2(marker_x, 1), Vector2(marker_x, size.y - 1), Color(0.94, 0.94, 0.79, 0.65), 1.0)
|
||||
draw_colored_polygon(PackedVector2Array([
|
||||
Vector2(marker_x, size.y), Vector2(marker_x - 3, size.y + 4), Vector2(marker_x + 3, size.y + 4)
|
||||
]), Color("e7e7ca"))
|
||||
var marker_x: float = floorf(inner.position.x + inner.size.x * clampf(activation_ratio, 0.0, 1.0))
|
||||
draw_line(Vector2(marker_x, 1), Vector2(marker_x, size.y - 1), Color(0.85, 0.77, 0.56, 0.7), 1.0)
|
||||
if highlighted:
|
||||
var strength: float = 0.7
|
||||
var strength: float = 0.4
|
||||
if animations_enabled and not Engine.is_editor_hint():
|
||||
strength = 0.65 + sin(_pulse_phase) * 0.2
|
||||
draw_rect(Rect2(Vector2(-1, -1), size + Vector2(2, 2)), Color(fill_color, strength), false, 1.0)
|
||||
strength = 0.35 + sin(_pulse_phase) * 0.13
|
||||
draw_line(Vector2(1, 0), Vector2(maxf(filled_width, 1.0), 0), Color(fill_color.lightened(0.7), strength), 1.0)
|
||||
if _damage_flash > 0.0 and animations_enabled and not Engine.is_editor_hint():
|
||||
draw_rect(Rect2(Vector2.ZERO, size), Color(1.0, 0.87, 0.76, _damage_flash * 1.5))
|
||||
|
||||
|
||||
## Recorta cada segmento en diagonal sin texturas adicionales ni shaders.
|
||||
func _draw_segment(rect: Rect2, fraction: float, color: Color) -> void:
|
||||
if fraction <= 0.0:
|
||||
return
|
||||
var bevel: float = minf(3.0, rect.size.x * 0.25)
|
||||
var length: float = (rect.size.x - bevel) * fraction
|
||||
var origin: Vector2 = rect.position
|
||||
draw_colored_polygon(PackedVector2Array([
|
||||
origin + Vector2(bevel, 0), origin + Vector2(bevel + length, 0),
|
||||
origin + Vector2(length, rect.size.y), origin + Vector2(0, rect.size.y)
|
||||
]), color)
|
||||
Reference in new issue
Block a user