Skip to main content

Characterbio

Based on game build 714014 | Last updated: 2026-03-08

Overview

CharacterBio is a UI widget responsible for displaying a character's bio screen in the Redux UI system. It constructs and arranges portrait graphics, status badges (health, hunger, sanity), starting inventory, and a scrollable text area containing title, description, and quote sections sourced from localization strings. It inherits from Widget and acts as a self-contained container for character information presentation during character selection or review.

Usage example

local CharacterBio = require "widgets/redux/characterbio"
local bio_widget = CharacterBio("wolfgang")
-- bio_widget is now a fully constructed widget that can be added to a parent UI

Dependencies & tags

Components used: None (pure UI widget, no game component interaction) Tags: None identified.

Properties

PropertyTypeDefault ValueDescription
portrait_rootWidgetnilContainer widget holding the character portrait, name, and status/inventory badges.
text_rootWidgetnilContainer widget for the bio text layout and scroll area.
portraitImagenilOval-shaped character portrait image.
characternameImagenilGold-text character name image; hidden on failure.
health_statusWidgetnilHealth status badge (via TEMPLATES.MakeUIStatusBadge).
hunger_statusWidgetnilHunger status badge.
sanity_statusWidgetnilSanity status badge.
invWidgetnilStarting inventory display widget.
scroll_areaTrueScrollAreanilScrollable container for the bio text sections.
focus_forwardWidgetscroll_areaEnables focus navigation forwarding to the scroll area.

Main functions

_BuildPortraitWidgets(character)

  • Description: Constructs and returns a widget containing the character's portrait, name, status badges, and inventory widgets.
  • Parameters: character (string) — character prefabricated name used to look up textures and data.
  • Returns: Widget — root container for all portrait-related UI elements.
  • Error states: If SetHeroNameTexture_Gold fails to set the name texture, charactername is hidden.

_BuildBioText(character)

  • Description: Constructs and returns a scrollable text widget containing the character's bio data split into sections (title, about me, description, quote).
  • Parameters: character (string) — character prefabricated name used to fetch localized strings.
  • Returns: Widget — root container with scrollable text area.
  • Error states: Text sections are rendered regardless of content availability; empty or missing localized strings produce blank sections.

Events & listeners

None identified.