Skip to content

Game.UI.Widgets.Column

Assembly:
Assembly-CSharp (typical game assembly; replace with actual assembly if different)

Namespace:
Game.UI.Widgets

Type:
internal class Column

Base:
LayoutContainer

Summary:
A lightweight vertical layout container type used by the game's UI system. Column is an internal class that derives from LayoutContainer and provides a convenience factory method to create a Column and set its child widgets in a single call. It relies on the inherited layout behaviour from LayoutContainer to arrange its children vertically.


Fields

  • None declared in this type.
    Column does not declare private fields in this file; it uses fields/properties inherited from LayoutContainer (for example an inherited children collection).

Properties

  • None declared in this type.
    Any relevant properties (such as the children collection or layout settings) are provided by the base class LayoutContainer.

Constructors

  • internal Column()
    The parameterless constructor is implicit. Since the class does not declare any constructors explicitly, the compiler provides a default constructor with the same accessibility as the class (internal). Use the static factory method WithChildren to construct and initialize a Column in one step.

Methods

  • public static Column WithChildren(IList<IWidget> children)
    Creates a new Column instance and assigns the provided list to the inherited children collection via an object initializer. Note that the method does not validate the passed list (e.g., it does not check for null), so callers should ensure the argument is valid. The method is a convenience factory to avoid separate instantiation and children assignment.

Usage Example

// Create some widgets (IWidget implementations)
IWidget header = new LabelWidget("Header");
IWidget item1 = new ButtonWidget("Item 1");
IWidget item2 = new ButtonWidget("Item 2");

// Create a column with those children in one call
var column = Column.WithChildren(new List<IWidget> { header, item1, item2 });

// Alternatively, if you need to prepare the list first:
var children = new List<IWidget>();
children.Add(header);
children.Add(item1);
children.Add(item2);
var column2 = Column.WithChildren(children);

Notes and tips: - Because Column is internal, it is intended for use inside the same assembly. When modding, ensure you have appropriate access or use reflection if necessary. - The created Column uses the layout behaviour defined by LayoutContainer. Configure layout parameters on the Column or its children via the base class API when needed. - The factory method does not perform null checks — consider validating inputs before calling WithChildren to avoid NullReferenceException.