Table of Contents

Class FlexalonMasonryLayout

Namespace
Flexalon
Assembly
Flexalon.dll

Use a masonry layout to arrange items of different sizes into columns, like a photo gallery. By default, each item is placed in whichever column is currently shortest, so the columns stay roughly even.

[AddComponentMenu("Flexalon/Flexalon Masonry Layout")]
[HelpURL("https://www.flexalon.com/docs/masonryLayout")]
public class FlexalonMasonryLayout : FlexalonLayoutBase, IFlexalonLayout
Inheritance
object
Object
Component
Behaviour
MonoBehaviour
FlexalonMasonryLayout
Implements
Inherited Members

Properties

ColumnAssignment

How children are assigned to columns.

public FlexalonMasonryLayout.ColumnAssignmentTypes ColumnAssignment { get; set; }

Property Value

FlexalonMasonryLayout.ColumnAssignmentTypes

ColumnDefinitions

The definitions of the masonry columns.

public List<FlexalonMasonryLayout.ColumnDefinition> ColumnDefinitions { get; set; }

Property Value

List<FlexalonMasonryLayout.ColumnDefinition>

ColumnDirection

The direction in which columns are placed.

public Direction ColumnDirection { get; set; }

Property Value

Direction

ColumnGap

The fixed gap between columns.

public float ColumnGap { get; set; }

Property Value

float

Columns

The number of columns in the masonry layout.

public int Columns { get; }

Property Value

int

DepthAlign

How to align the complete line of columns in depth.

public Align DepthAlign { get; set; }

Property Value

Align

HorizontalAlign

How to align the complete line of columns horizontally.

public Align HorizontalAlign { get; set; }

Property Value

Align

StackDirection

The direction in which children are stacked within each column.

public Direction StackDirection { get; set; }

Property Value

Direction

StackGap

The fixed gap between children within each column.

public float StackGap { get; set; }

Property Value

float

VerticalAlign

How to align the complete line of columns vertically.

public Align VerticalAlign { get; set; }

Property Value

Align

Methods

AddColumn()

Adds a Layout-sized column to the end of the layout.

public void AddColumn()

AddColumn(ColumnDefinition)

Adds a column to the end of the layout.

public void AddColumn(FlexalonMasonryLayout.ColumnDefinition definition)

Parameters

definition FlexalonMasonryLayout.ColumnDefinition

Arrange(IFlexalonNode, Vector3)

Position the children of node within the available bounds.

public override void Arrange(IFlexalonNode node, Vector3 layoutSize)

Parameters

node IFlexalonNode
layoutSize Vector3

ClearColumns()

Removes all columns.

public void ClearColumns()

InsertColumn(int)

Inserts a Layout-sized column at the specified index.

public void InsertColumn(int index)

Parameters

index int

InsertColumn(int, ColumnDefinition)

Inserts a column at the specified index.

public void InsertColumn(int index, FlexalonMasonryLayout.ColumnDefinition definition)

Parameters

index int
definition FlexalonMasonryLayout.ColumnDefinition

Measure(IFlexalonNode, Vector3, Vector3, Vector3)

Perform minimal work to determine what the size of node and available size for node's children.

public override Bounds Measure(IFlexalonNode node, Vector3 size, Vector3 min, Vector3 max)

Parameters

node IFlexalonNode
size Vector3
min Vector3
max Vector3

Returns

Bounds

RemoveColumn(int)

Removes the column at the specified index.

public void RemoveColumn(int index)

Parameters

index int

ReplaceColumn(int, ColumnDefinition)

Replaces the column at the specified index.

public void ReplaceColumn(int index, FlexalonMasonryLayout.ColumnDefinition definition)

Parameters

index int
definition FlexalonMasonryLayout.ColumnDefinition