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

34 lines
1.2 KiB
GDScript

class_name ABGM52GuildMemberCard
extends Control
const InitialCompanyArt = preload("res://entry/initial_company_art.gd")
var recruit: Dictionary = {}
var member_index := 0
func configure(next_index: int, next_recruit: Dictionary) -> ABGM52GuildMemberCard:
member_index = next_index
recruit = next_recruit
return self
func _ready() -> void:
mouse_filter = Control.MOUSE_FILTER_IGNORE
var shadow := ColorRect.new()
shadow.name = "GuildMemberGround_%d" % member_index
shadow.anchor_left = 0.18
shadow.anchor_top = 0.88
shadow.anchor_right = 0.82
shadow.anchor_bottom = 0.915
shadow.color = Color(0.02, 0.08, 0.08, 0.24)
shadow.mouse_filter = Control.MOUSE_FILTER_IGNORE
add_child(shadow)
var portrait := TextureRect.new()
portrait.name = "GuildMemberPortraitTexture_%d" % member_index
portrait.texture = InitialCompanyArt.texture_for(recruit)
portrait.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
portrait.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
portrait.texture_filter = CanvasItem.TEXTURE_FILTER_LINEAR_WITH_MIPMAPS
portrait.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
portrait.mouse_filter = Control.MOUSE_FILTER_IGNORE
add_child(portrait)