Attempted to figure how to adjust notification label size. Nah.
This commit is contained in:
parent
dd4652b732
commit
4f90c82b8f
4 changed files with 15 additions and 19 deletions
|
|
@ -1,15 +0,0 @@
|
|||
extends Label
|
||||
|
||||
var last_time = 0
|
||||
var frame_count = 0
|
||||
var fps = 0
|
||||
|
||||
func _process(delta):
|
||||
frame_count += 1
|
||||
last_time += delta
|
||||
|
||||
if last_time >= 1.0: # Update every second
|
||||
fps = frame_count
|
||||
text = " " + str(fps) + " FPS"
|
||||
last_time = 0
|
||||
frame_count = 0
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://eblemtukrey6
|
||||
|
|
@ -13,7 +13,19 @@ var _connector_line: Line2D = null
|
|||
var _connector_visible: bool = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# Start fully transparent so the initial (0,0) position is invisible.
|
||||
# This runs during add_child() before any rendering occurs.
|
||||
modulate.a = 0.0
|
||||
|
||||
# 4px horizontal padding inside the background box
|
||||
_container.add_theme_constant_override("margin_left", 4)
|
||||
_container.add_theme_constant_override("margin_right", 4)
|
||||
|
||||
|
||||
func show_notification(weapon_name: String, player_node: Node2D, player_sprite_size: Vector2, origin_offset: float) -> void:
|
||||
modulate.a = 0.0
|
||||
|
||||
label.add_theme_font_size_override("font_size", 8)
|
||||
label.text = weapon_name
|
||||
|
||||
|
|
@ -40,9 +52,8 @@ func show_notification(weapon_name: String, player_node: Node2D, player_sprite_s
|
|||
_update_position()
|
||||
var target_pos = position
|
||||
|
||||
# Start 10px above destination, fully transparent
|
||||
# Start 10px above destination (already transparent from line 17)
|
||||
position.y = target_pos.y - 10.0
|
||||
modulate.a = 0.0
|
||||
|
||||
# Create connector line immediately so it fades in with the notification
|
||||
_connector_line = Line2D.new()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue