Table of Contents

Class SquishingGroup

Namespace
MLEM.Ui.Elements
Assembly
MLEM.Ui.dll

A squishing group is a Group whose Children automatically get resized so that they do not overlap each other. Elements are squished in a way that maximizes the final area that each element retains compared to its original area. The order in which elements are squished depends on their Priority, where elements with a lower priority will move out of the way of elements with a higher priority. If all elements have the same priority, their addition order (their order in Children) determines squish order.

public class SquishingGroup : Group, IGenericDataHolder
Inheritance
SquishingGroup
Implements
Inherited Members
Extension Methods

Constructors

SquishingGroup(Anchor, Vector2)

Creates a new squishing group with the given settings.

public SquishingGroup(Anchor anchor, Vector2 size)

Parameters

anchor Anchor

The group's anchor.

size Vector2

The group's size.

Methods

OnChildAreaDirty(Element, bool)

A method that gets called by this element's Children or any of its grandchildren when their SetAreaDirty() methods get called. Note that the element's area might already be dirty, which will not stop this method from being called.

protected override void OnChildAreaDirty(Element child, bool grandchild)

Parameters

child Element

The child whose area is being set dirty.

grandchild bool

Whether the child is a grandchild of this element, rather than a direct child.

SetAreaAndUpdateChildren(RectangleF)

Sets this element's Area to the given RectangleF and invokes the OnElementAreaUpdated event. This method also updates all of this element's Children's areas. Note that this method does not take into account any auto-sizing, anchoring or positioning, and so it should be used sparingly, if at all.

public override void SetAreaAndUpdateChildren(RectangleF area)

Parameters

area RectangleF
See Also