27 lines
905 B
GDScript
27 lines
905 B
GDScript
class_name ABGM52GuildNavigation
|
|
extends Control
|
|
|
|
const UIFactory = preload("res://ui/shared/ui_factory.gd")
|
|
|
|
var items: Array[String] = []
|
|
|
|
func configure(next_items: Array[String]) -> ABGM52GuildNavigation:
|
|
items = next_items
|
|
return self
|
|
|
|
func _ready() -> void:
|
|
clip_contents = true
|
|
for index in range(items.size()):
|
|
var label := UIFactory.label(items[index], "micro", 1.0, Color("#f8e7b5"))
|
|
label.name = "NavigationLabel%d" % index
|
|
label.anchor_left = float(index) / float(items.size()) + 0.02
|
|
label.anchor_right = float(index + 1) / float(items.size()) - 0.02
|
|
label.anchor_top = 0.58
|
|
label.anchor_bottom = 0.95
|
|
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
|
label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
|
label.clip_text = true
|
|
label.text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS
|
|
label.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
|
add_child(label)
|