reckfellENGINE

Container

Base for child-Control layout algorithms.

On this page
class ContainerReckfellSharpInherits Control

Container manages direct child Controls. An ordinary intermediate Entity is not a layout item; TopLevel and hidden items are excluded from ordinary sorting. The base Container without a script supplies no useful placement: choose a concrete Box/Grid/Panel or implement your own algorithm.

QueueSort defers a pass and coalesces requests. A pass sends NotificationPreSortChildren and PreSortChildren before NotificationSortChildren and SortChildren. This is not a global completion signal for the entire layout tree. Measure final rectangles after the necessary passes.

For custom layout, FitChildInRect requires a direct child and a rectangle local to the container. It applies constraints/SizeFlags and resets Rotation to 0 and Scale to Vector2.One. To preserve animated transforms across layout passes, put animated content in an inner Control instead of animating the direct child.

_GetAllowedSizeFlagsHorizontal/Vertical are callbacks listing allowed flags for a custom container. Their generated base returns null; a direct call does not query a child’s current flags. AccessibilityRegion changes accessibility semantics rather than geometry or focus.

Container layout.

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

Constructors1

ContainerConstructor
# Container
C#
public Container();

Creates a base for custom layout; prefer a concrete container without a custom placement implementation.

Properties1

AccessibilityRegionProperty
# AccessibilityRegion
C#
public bool AccessibilityRegion { get; set; }

Accessibility-region semantic flag, false by default. Does not change geometry/focus routing; test screen-reader integration separately.

Methods6

FitChildInRectvoid
# FitChildInRect
C#
public void FitChildInRect(Control child, Rect2 rect);

Fits only a direct child Control into a local area using constraints/SizeFlags. Resets Rotation = 0 and Scale = One. Use in custom layout rather than fighting a concrete container’s layout.

Parameters
NameTypeDefault
childControl—
rectRect2—
child

Nonnull direct child Control of this container rather than another container’s child or a distant descendant.

rect

Rectangle with nonnegative dimensions in container-local coordinates; the result also follows constraints and SizeFlags.

IsAccessibilityRegionbool
# IsAccessibilityRegion
C#
public bool IsAccessibilityRegion();

Accessibility-region semantic flag, false by default. Does not change geometry/focus routing; test screen-reader integration separately.

Returns bool

Current flag bool rather than a screen-reader test result.

QueueSortvoid
# QueueSort
C#
public void QueueSort();

Requests a deferred pass while inside the tree; repeated requests coalesce. Does not lay out outside the tree. Neither synchronous recalculation nor a manual Position reset.

SetAccessibilityRegionvoid
# SetAccessibilityRegion
C#
public void SetAccessibilityRegion(bool region);

Accessibility-region semantic flag, false by default. Does not change geometry/focus routing; test screen-reader integration separately.

Parameters
NameTypeDefault
regionbool—
region

true for an accessibility-region role, false for an ordinary container.

_GetAllowedSizeFlagsHorizontalint[]
# _GetAllowedSizeFlagsHorizontal
C#
public virtual int[] _GetAllowedSizeFlagsHorizontal();

Callback listing allowed horizontal SizeFlags values for a custom container. Return enum-value int[] rather than a particular child’s flags. Generated base returns null.

Returns int[]

Implementation int[] of values; generated base returns null.

_GetAllowedSizeFlagsVerticalint[]
# _GetAllowedSizeFlagsVertical
C#
public virtual int[] _GetAllowedSizeFlagsVertical();

Callback listing a custom container’s allowed vertical SizeFlags values. Generated base returns null; not a getter for actual layout.

Returns int[]

Implementation int[] of values; generated base returns null.

Signals and events2

PreSortChildrenEvent
# PreSortChildren
C#
public event Action PreSortChildren;

Signal after NotificationPreSortChildren and before NotificationSortChildren. Suitable for layout preparation rather than reading final dimensions of the whole tree.

SortChildrenEvent
# SortChildren
C#
public event Action SortChildren;

Signal after this container’s NotificationSortChildren. Custom placement can use FitChildInRect. Other hierarchy levels may still relayout.

Fields and constants2

NotificationPreSortChildrenField
# NotificationPreSortChildren
C#
public const long NotificationPreSortChildren = 50;

Notification code before sorting children, for a custom container _Notification. PreSortChildren follows it.

NotificationSortChildrenField
# NotificationSortChildren
C#
public const long NotificationSortChildren = 51;

Notification code for child placement during a sort pass. SortChildren follows the notification. Not completion of the whole UI tree.

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.