Skip to content

Class GridItemLayout

Definition

Namespace: StardewUI.Widgets
Assembly: StardewUI.dll

Describes the layout of all items in a Grid.

public record GridItemLayout : IEquatable<StardewUI.Widgets.GridItemLayout>

Inheritance
Object ⇦ GridItemLayout

Implements
IEquatable<GridItemLayout>

Members

Properties

Name Description
EqualityContract

Methods

Name Description
GetItemCountAndLength(Single, Single) Computes the length (along the grid's PrimaryOrientation axis) of a single item, and the number of items that can fit before wrapping.
Parse(string) Converts the string representation of an item layout to an equivalent GridItemLayout.

Details

Properties

EqualityContract

protected System.Type EqualityContract { get; }
Property Value

Type


Methods

GetItemCountAndLength(float, float)

Computes the length (along the grid's PrimaryOrientation axis) of a single item, and the number of items that can fit before wrapping.

public virtual ValueTuple<System.Single, System.Int32> GetItemCountAndLength(float available, float spacing);
Parameters

available   Single
The length available along the same axis.

spacing   Single
Spacing between items, to adjust count-based layouts.

Returns

ValueTuple<Single, Int32>

The length to apply to each item.


Parse(string)

Converts the string representation of an item layout to an equivalent GridItemLayout.

public static StardewUI.Widgets.GridItemLayout Parse(string value);
Parameters

value   string
String containing the item layout to convert.

Returns

GridItemLayout

The converted layout information.