reckfellENGINE

FoldableContainer

Container with a title and collapsible content.

On this page
class FoldableContainerReckfellSharpInherits Container

Place content inside one nested VBoxContainer or another layout container: direct child Controls receive the same inner rectangle and can overlap. Folding hides them and expanding shows them again; manage independent visibility inside the nested container.

Folded sets state without FoldingChanged; Fold/Expand commands emit the actual state. FoldableGroup combines sections into an accordion.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

FoldableContainerConstructor
# FoldableContainer
C#
public FoldableContainer();

Creates a foldable container. Add it to a parent, set Title and place content in a nested layout container.

Properties8

FoldableGroupProperty
# FoldableGroup
C#
public FoldableGroup FoldableGroup { get; set; }

Shared expansion-coordination resource. Assignment joins the new group, leaves the old one and may immediately adjust Folded. null disables coordination.

FoldedProperty
# Folded
C#
public bool Folded { get; set; }

Folding state. The setter requests layout updates without emitting FoldingChanged. A group may reject folding the last expanded member; reread IsFolded after assignment. Layout assigns direct child Controls Visible = !Folded.

LanguageProperty
# Language
C#
public string Language { get; set; }

Title shaping language hint. Does not itself translate it; UI translation separately uses source Title.

TitleProperty
# Title
C#
public string Title { get; set; }

Source title, translated through UI translation for display. The getter returns the source string. Does not create a child Label or set the entity name.

TitleAlignmentProperty
# TitleAlignment
C#
public HorizontalAlignment TitleAlignment { get; set; }

Title alignment: Left, Center or Right; Fill is unsupported. RTL mirrors left/right presentation. Does not align content controls.

TitlePositionProperty
# TitlePosition
C#
public FoldableContainer.TitlePositionEnum TitlePosition { get; set; }

Places the title bar above or below content. Changes layout rather than child entity order.

TitleTextDirectionProperty
# TitleTextDirection
C#
public Control.TextDirection TitleTextDirection { get; set; }

Title shaping direction; neither reverses the source string nor controls all content direction.

TitleTextOverrunBehaviorProperty
# TitleTextOverrunBehavior
C#
public TextServer.OverrunBehavior TitleTextOverrunBehavior { get; set; }

Title overflow behavior, such as trimming or ellipsis. Does not change stored Title.

Methods22

AddTitleBarControlvoid
# AddTitleBarControl
C#
public void AddTitleBarControl(Control control);

Moves a Control into the title bar’s internal children, removing it from its previous parent. Configure ownership/saving separately when building a prefab. Do not add the same control twice. It is freed with the container while remaining its child.

Parameters
NameTypeDefault
controlControl—
control

Valid title-bar Control.

Expandvoid
# Expand
C#
public void Expand();

Requests Folded false and emits FoldingChanged with actual state even when already expanded. May fold other group members.

Foldvoid
# Fold
C#
public void Fold();

Requests Folded true, then emits FoldingChanged with actual state even if unchanged or rejected by the group. Does not delete content.

GetFoldableGroupFoldableGroup
# GetFoldableGroup
C#
public FoldableGroup GetFoldableGroup();

Shared expansion-coordination resource. Assignment joins the new group, leaves the old one and may immediately adjust Folded. null disables coordination.

Returns FoldableGroup

Shared expansion-coordination resource. Assignment joins the new group, leaves the old one and may immediately adjust Folded. null disables coordination.

GetLanguagestring
# GetLanguage
C#
public string GetLanguage();

Title shaping language hint. Does not itself translate it; UI translation separately uses source Title.

Returns string

Title shaping language hint. Does not itself translate it; UI translation separately uses source Title.

GetTitlestring
# GetTitle
C#
public string GetTitle();

Source title, translated through UI translation for display. The getter returns the source string. Does not create a child Label or set the entity name.

Returns string

Source title, translated through UI translation for display. The getter returns the source string. Does not create a child Label or set the entity name.

GetTitleAlignmentHorizontalAlignment
# GetTitleAlignment
C#
public HorizontalAlignment GetTitleAlignment();

Title alignment: Left, Center or Right; Fill is unsupported. RTL mirrors left/right presentation. Does not align content controls.

Returns HorizontalAlignment

Title alignment: Left, Center or Right; Fill is unsupported. RTL mirrors left/right presentation. Does not align content controls.

GetTitleBarControlControl
# GetTitleBarControl
C#
public Control GetTitleBarControl(long index);

Returns a registered Control at its current index. A borrowed reference rather than a copy: do not free a control still used in the title bar. Removing entries shifts indices.

Parameters
NameTypeDefault
indexlong—
index

Current index from zero through GetTitleBarControlCount() - 1.

Returns Control

Returns a registered Control at its current index. A borrowed reference rather than a copy: do not free a control still used in the title bar. Removing entries shifts indices.

GetTitleBarControlCountint
# GetTitleBarControlCount
C#
public int GetTitleBarControlCount();

Count of AddTitleBarControl entries rather than content children.

Returns int

Count of AddTitleBarControl entries rather than content children.

GetTitlePositionFoldableContainer.TitlePositionEnum
# GetTitlePosition
C#
public FoldableContainer.TitlePositionEnum GetTitlePosition();

Places the title bar above or below content. Changes layout rather than child entity order.

Returns FoldableContainer.TitlePositionEnum

Places the title bar above or below content. Changes layout rather than child entity order.

GetTitleTextDirectionControl.TextDirection
# GetTitleTextDirection
C#
public Control.TextDirection GetTitleTextDirection();

Title shaping direction; neither reverses the source string nor controls all content direction.

Returns Control.TextDirection

Title shaping direction; neither reverses the source string nor controls all content direction.

GetTitleTextOverrunBehaviorTextServer.OverrunBehavior
# GetTitleTextOverrunBehavior
C#
public TextServer.OverrunBehavior GetTitleTextOverrunBehavior();

Title overflow behavior, such as trimming or ellipsis. Does not change stored Title.

Returns TextServer.OverrunBehavior

Title overflow behavior, such as trimming or ellipsis. Does not change stored Title.

IsFoldedbool
# IsFolded
C#
public bool IsFolded();

Folding state. The setter requests layout updates without emitting FoldingChanged. A group may reject folding the last expanded member; reread IsFolded after assignment. Layout assigns direct child Controls Visible = !Folded.

Returns bool

Folding state. The setter requests layout updates without emitting FoldingChanged. A group may reject folding the last expanded member; reread IsFolded after assignment. Layout assigns direct child Controls Visible = !Folded.

RemoveTitleBarControlvoid
# RemoveTitleBarControl
C#
public void RemoveTitleBarControl(Control control);

Removes a registered title-bar Control and detaches it without freeing it. Reparent it or free it when no longer needed.

Parameters
NameTypeDefault
controlControl—
control

Valid title-bar Control.

SetFoldableGroupvoid
# SetFoldableGroup
C#
public void SetFoldableGroup(FoldableGroup buttonGroup);

Shared expansion-coordination resource. Assignment joins the new group, leaves the old one and may immediately adjust Folded. null disables coordination.

Parameters
NameTypeDefault
buttonGroupFoldableGroup—
buttonGroup

Shared FoldableGroup or null.

SetFoldedvoid
# SetFolded
C#
public void SetFolded(bool folded);

Folding state. The setter requests layout updates without emitting FoldingChanged. A group may reject folding the last expanded member; reread IsFolded after assignment. Layout assigns direct child Controls Visible = !Folded.

Parameters
NameTypeDefault
foldedbool—
folded

Requested state; the group may reject folding.

SetLanguagevoid
# SetLanguage
C#
public void SetLanguage(string language);

Title shaping language hint. Does not itself translate it; UI translation separately uses source Title.

Parameters
NameTypeDefault
languagestring—
language

Shaping language hint code.

SetTitlevoid
# SetTitle
C#
public void SetTitle(string text);

Source title, translated through UI translation for display. The getter returns the source string. Does not create a child Label or set the entity name.

Parameters
NameTypeDefault
textstring—
text

Source title for UI translation.

SetTitleAlignmentvoid
# SetTitleAlignment
C#
public void SetTitleAlignment(HorizontalAlignment alignment);

Title alignment: Left, Center or Right; Fill is unsupported. RTL mirrors left/right presentation. Does not align content controls.

Parameters
NameTypeDefault
alignmentHorizontalAlignment—
alignment

Left, Center or Right; Fill is unsupported.

SetTitlePositionvoid
# SetTitlePosition
C#
public void SetTitlePosition(FoldableContainer.TitlePositionEnum titlePosition);

Places the title bar above or below content. Changes layout rather than child entity order.

Parameters
NameTypeDefault
titlePositionFoldableContainer.TitlePositionEnum—
titlePosition

Top or bottom title position.

SetTitleTextDirectionvoid
# SetTitleTextDirection
C#
public void SetTitleTextDirection(Control.TextDirection textDirection);

Title shaping direction; neither reverses the source string nor controls all content direction.

Parameters
NameTypeDefault
textDirectionControl.TextDirection—
textDirection

Title shaping direction.

SetTitleTextOverrunBehaviorvoid
# SetTitleTextOverrunBehavior
C#
public void SetTitleTextOverrunBehavior(TextServer.OverrunBehavior overrunBehavior);

Title overflow behavior, such as trimming or ellipsis. Does not change stored Title.

Parameters
NameTypeDefault
overrunBehaviorTextServer.OverrunBehavior—
overrunBehavior

Title overflow behavior.

Signals and events1

FoldingChangedEvent
# FoldingChanged
C#
public event FoldableContainer.FoldingChangedEventHandler FoldingChanged;

Notification from Fold/Expand or a user toggle. isFolded is actual state rather than a promise that it changed. Direct SetFolded and automatic changes to other group members need not emit this event.

Handler parameters
NameTypeDefault
isFoldedbool—
isFolded

Actual state after the request rather than a changed-value flag.

FoldableContainer.TitlePositionEnum

ValueDescription
Bottom = 1

Makes the title appear at the bottom of the container. Also makes all StyleBoxes flipped vertically.

Top = 0

Makes the title appear at the top of the container.

Theme properties

These are Theme resource keys, not C# properties. Use the matching Control GetTheme…() and AddTheme…Override() methods for each value type.

Key and typeDescription
collapsed_font_color
Color

The title's font color when collapsed.

Default: Color(1, 1, 1, 1)
font_color
Color

The title's font color when expanded.

Default: Color(0.875, 0.875, 0.875, 1)
font_outline_color
Color

The title's font outline color.

Default: Color(1, 1, 1, 1)
hover_font_color
Color

The title's font hover color.

Default: Color(0.95, 0.95, 0.95, 1)
h_separation
int

The horizontal separation between the title's icon and text, and between title bar controls.

Default: 2
icon_max_width
int

The maximum allowed width of the FoldableContainer's icon. The height is adjusted according to the icon's ratio.

Default: 0
outline_size
int

The title's font outline size.

Default: 0
font
Font

The title's font.

font_size
int

The title's font size.

expanded_arrow
Texture2D

The title's icon used when expanded.

expanded_arrow_mirrored
Texture2D

The title's icon used when expanded (for bottom title).

folded_arrow
Texture2D

The title's icon used when folded (for left-to-right layouts).

folded_arrow_mirrored
Texture2D

The title's icon used when collapsed (for right-to-left layouts).

expanded_sound
AudioStream

Played when the container is expanded with any input method.

focus_sound
AudioStream

Played when this FoldableContainer receives keyboard or gamepad-induced focus. Mouse or touch-induced focus does not play a focus sound.

folded_sound
AudioStream

Played when the container is folded with any input method. Note: This does not play if the container is folded as a result of being part of a FoldableGroup and another container in the same group was expanded.

focus
StyleBox

Background used when FoldableContainer has GUI focus. The FoldableContainer.focus StyleBox is displayed over the base StyleBox, so a partially transparent StyleBox should be used to ensure the base StyleBox remains visible. A StyleBox that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a StyleBoxEmpty resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.

panel
StyleBox

Default background for the FoldableContainer.

title_collapsed_hover_panel
StyleBox

Background used when the mouse cursor enters the title's area when collapsed.

title_collapsed_panel
StyleBox

Default background for the FoldableContainer's title when collapsed.

title_hover_panel
StyleBox

Background used when the mouse cursor enters the title's area when expanded.

title_panel
StyleBox

Default background for the FoldableContainer's title when expanded.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.