Class GridItemLayout.Length
Definition
Namespace: StardewUI.Widgets
Assembly: StardewUI.dll
A GridItemLayout specifying that each item is to have the same fixed length (width or height, depending on the grid's Orientation) and to wrap to the next row/column afterward.
public record GridItemLayout.Length : StardewUI.Widgets.GridItemLayout,
IEquatable<StardewUI.Widgets.GridItemLayout.Length>
Inheritance
Object ⇦ GridItemLayout ⇦ Length
Implements
IEquatable<Length>
Members
Constructors
| Name | Description |
|---|---|
| Length(Single, Boolean) | A GridItemLayout specifying that each item is to have the same fixed length (width or height, depending on the grid's Orientation) and to wrap to the next row/column afterward. |
Properties
| Name | Description |
|---|---|
| EqualityContract | (Overrides GridItemLayout.get_EqualityContract()) |
| Expandable | Whether the length of cells should expand (uniformly) to fill the grid's primary layout size, i.e. when that size is not an exact multiple of the total size of all cells that can fit. |
| Px | The length, in pixels, of each item along the grid's orientation axis. |
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. (Overrides GridItemLayout.GetItemCountAndLength(Single, Single)) |
Details
Constructors
Length(float, bool)
A GridItemLayout specifying that each item is to have the same fixed length (width or height, depending on the grid's Orientation) and to wrap to the next row/column afterward.
Parameters
Px Single
The length, in pixels, of each item along the grid's orientation axis.
Expandable Boolean
Whether the length of cells should expand (uniformly) to fill the grid's primary layout size, i.e. when that size is not an exact multiple of the total size of all cells that can fit.
Properties
EqualityContract
Property Value
Expandable
Whether the length of cells should expand (uniformly) to fill the grid's primary layout size, i.e. when that size is not an exact multiple of the total size of all cells that can fit.
Property Value
Px
The length, in pixels, of each item along the grid's orientation axis.
Property Value
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 override 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
The length to apply to each item.