fix: XP-Bar Abstand vom Rand + Level-Label in XP-Bar integriert
- XP-Bar: 6px Abstand vom unteren Bildschirmrand - Level-Label entfernt aus oben-links, jetzt Teil der XP-Bar: "Lv X current/max XP" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8ddc20683b
commit
6b46b27c2a
1 changed files with 6 additions and 8 deletions
14
hud.gd
14
hud.gd
|
|
@ -235,12 +235,10 @@ func _create_level_ui():
|
||||||
resource_bar.add_child(resource_label)
|
resource_bar.add_child(resource_label)
|
||||||
control.add_child(resource_bar)
|
control.add_child(resource_bar)
|
||||||
|
|
||||||
# Level Label oben links
|
# Level Label — wird in update_level() über XPLabel gesetzt, kein eigenes Node nötig
|
||||||
level_label = Label.new()
|
level_label = Label.new() # Dummy damit update_level() nicht crasht
|
||||||
level_label.name = "LevelLabel"
|
level_label.name = "LevelLabel"
|
||||||
level_label.position = Vector2(20, 74)
|
level_label.visible = false
|
||||||
level_label.add_theme_font_size_override("font_size", 14)
|
|
||||||
level_label.text = "Level 1"
|
|
||||||
control.add_child(level_label)
|
control.add_child(level_label)
|
||||||
|
|
||||||
# Gold Label oben links
|
# Gold Label oben links
|
||||||
|
|
@ -261,8 +259,8 @@ func _create_level_ui():
|
||||||
xp_bar.anchor_bottom = 1.0
|
xp_bar.anchor_bottom = 1.0
|
||||||
xp_bar.offset_left = -234.0
|
xp_bar.offset_left = -234.0
|
||||||
xp_bar.offset_right = 234.0
|
xp_bar.offset_right = 234.0
|
||||||
xp_bar.offset_top = -12.0
|
xp_bar.offset_top = -18.0
|
||||||
xp_bar.offset_bottom = 0.0
|
xp_bar.offset_bottom = -6.0
|
||||||
xp_bar.show_percentage = false
|
xp_bar.show_percentage = false
|
||||||
xp_bar.value = 0
|
xp_bar.value = 0
|
||||||
xp_bar.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
xp_bar.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
|
|
@ -353,7 +351,7 @@ func update_level(level: int, current_xp: int, xp_to_next: int):
|
||||||
xp_bar.value = current_xp
|
xp_bar.value = current_xp
|
||||||
var xp_label = xp_bar.get_node_or_null("XPLabel")
|
var xp_label = xp_bar.get_node_or_null("XPLabel")
|
||||||
if xp_label:
|
if xp_label:
|
||||||
xp_label.text = "Level %d — %d / %d XP" % [level, current_xp, xp_to_next]
|
xp_label.text = "Lv %d %d / %d XP" % [level, current_xp, xp_to_next]
|
||||||
|
|
||||||
# Aktions-Slot kurz golden hervorheben (0.1s)
|
# Aktions-Slot kurz golden hervorheben (0.1s)
|
||||||
func set_active_slot(index):
|
func set_active_slot(index):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue