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

40 lines
1.4 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:
clip_contents = true
var title := UIFactory.label(title_text, "title", 1.0, Color("#23323a"))
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
add_child(title)
var subtitle := UIFactory.label(subtitle_text, "micro", 1.0, Color("#5e513a"))
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
add_child(subtitle)