Files
aetherbound-guild/runtime/ui/m52/guild_header.gd
T

45 lines
1.7 KiB
GDScript

class_name ABGM52GuildHeader
extends Control
const UIFactory = preload("res://ui/shared/ui_factory.gd")
var title_text := "公会大厅"
var subtitle_text := "持续远征团"
func configure(next_title: String, next_subtitle: String) -> ABGM52GuildHeader:
title_text = next_title
subtitle_text = next_subtitle
return self
func _ready() -> void:
mouse_filter = Control.MOUSE_FILTER_IGNORE
clip_contents = true
var title := UIFactory.label(title_text, "title", 1.0, Color("#fff4d6"))
title.name = "GuildAnchorTitle"
title.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
title.anchor_left = 0.08
title.anchor_top = 0.08
title.anchor_right = 0.92
title.anchor_bottom = 0.58
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
title.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
title.clip_text = true
title.text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS
title.add_theme_color_override("font_outline_color", Color(0.03, 0.07, 0.09, 0.95))
title.add_theme_constant_override("outline_size", 3)
add_child(title)
var subtitle := UIFactory.label(subtitle_text, "micro", 1.0, Color("#ffe5a8"))
subtitle.name = "GuildAnchorStatus"
subtitle.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
subtitle.anchor_left = 0.12
subtitle.anchor_top = 0.58
subtitle.anchor_right = 0.88
subtitle.anchor_bottom = 0.96
subtitle.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
subtitle.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
subtitle.clip_text = true
subtitle.text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS
subtitle.add_theme_color_override("font_outline_color", Color(0.03, 0.07, 0.09, 0.9))
subtitle.add_theme_constant_override("outline_size", 2)
add_child(subtitle)