Table of Contents

Class CoveringGroup

Namespace
TinyLife.Uis
Assembly
Tiny Life.dll

A covering group is a group that has additional functionality. This functionality includes displaying a gradient background that can be clicked on to exit, adding a close button to any MLEM.Ui.Elements.Panel added, and displaying an opening and closing animation. To close a covering group while keeping animations and closing conditions in mind, use Close(bool).

public class CoveringGroup : Group, IGenericDataHolder
Inheritance
GenericDataHolder
Element
Group
CoveringGroup
Implements
IGenericDataHolder
Inherited Members
Element.Epsilon
Element.Controls
Element.ScrollOffset
Element.Transform
Element.SelectionIndicator
Element.ActionSound
Element.SecondActionSound
Element.Padding
Element.MouseEnterAnimation
Element.MouseExitAnimation
Element.OnDrawn
Element.OnUpdated
Element.OnPressed
Element.OnSecondaryPressed
Element.OnSelected
Element.OnDeselected
Element.OnMouseEnter
Element.OnMouseExit
Element.OnTouchEnter
Element.OnTouchExit
Element.OnTextInput
Element.OnAreaUpdated
Element.OnStyleInit
Element.OnMousedElementChanged
Element.OnTouchedElementChanged
Element.OnSelectedElementChanged
Element.GetTabNextElement
Element.GetGamepadNextElement
Element.OnChildAdded
Element.OnChildRemoved
Element.OnAddedToUi
Element.OnRemovedFromUi
Element.Children
Element.PlayingAnimations
Element.RemoveChild(Element)
Element.SetSortedChildrenDirty()
Element.UpdateSortedChildrenIfDirty()
Element.ForceUpdateSortedChildren()
Element.SetAreaDirty()
Element.UpdateAreaIfDirty()
Element.ForceUpdateArea()
Element.SetAreaAndUpdateChildren(RectangleF)
Element.CalcActualSize(RectangleF)
Element.GetAreaForAutoAnchors()
Element.GetParentTree()
Element.GetRelevantChildren()
Element.Update(GameTime)
Element.GetElementUnderPos(Vector2)
Element.PlayAnimation(UiAnimation)
Element.StopAnimation(UiAnimation)
Element.ToString()
Element.InitStyle(UiStyle)
Element.TransformInverse(Vector2)
Element.TransformInverseAll(Vector2)
Element.AddedToUi(UiSystem, RootElement)
Element.RemovedFromUi()
Element.System
Element.Parent
Element.Root
Element.Scale
Element.Anchor
Element.Size
Element.ScaledSize
Element.AutoSizeAddedAbsolute
Element.ScaledAutoSizeAddedAbsolute
Element.PositionOffset
Element.ScaledOffset
Element.ScaledPadding
Element.ScaledChildPadding
Element.ChildPaddedArea
Element.UnscrolledArea
Element.Area
Element.DisplayArea
Element.ScaledScrollOffset
Element.IsHidden
Element.Priority
Element.CanBeSelected
Element.CanBeMoused
Element.CanBePressed
Element.CanAutoAnchorsAttach
Element.SetWidthBasedOnChildren
Element.SetHeightBasedOnChildren
Element.TreatSizeAsMinimum
Element.TreatSizeAsMaximum
Element.PreventParentSpill
Element.DrawAlpha
Element.IsMouseOver
Element.IsSelected
Element.IsSelectedActive
Element.AreaDirty
Element.AutoNavGroup
Element.Style
Element.ChildPadding
Element.SortedChildren
Element.Input
Element.ParentArea
GenericDataHolder.GetDataKeys()
Extension Methods

Constructors

CoveringGroup(bool, Func<CoveringGroup, bool>, bool, bool)

Creates a new covering group with the given settings.

public CoveringGroup(bool background = true, Func<CoveringGroup, bool> exitCondition = null, bool hasCloseButton = true, bool openFancy = true)

Parameters

background bool

Whether a background should be rendered behind this covering group.

exitCondition Func<CoveringGroup, bool>

A condition that determines whether this covering group can be closed by clicking the close button or the background. If this is null, the ui can always be closed.

hasCloseButton bool

Whether a close button should be added to the first MLEM.Ui.Elements.Panel that is added as a child

openFancy bool

Whether an opening animation should play when opening this covering group. Note that, if UiAnimations is disabled, this value will be ignored.

Methods

Close(bool)

Closes this covering group, optionally displaying a closing animation. Note that this method ignores the covering group's exit condition.

public void Close(bool closeFancy = true)

Parameters

closeFancy bool

Whether a closing animation should display. Note that, if UiAnimations is disabled, this value will be ignored.

Draw(GameTime, SpriteBatch, float, SpriteBatchContext)

Draws this element and all of its children. Override this method to draw the content of custom elements. Note that, when this is called, SpriteBatch.Begin has already been called with custom MLEM.Ui.Elements.Element.Transform etc. applied.

public override void Draw(GameTime time, SpriteBatch batch, float alpha, SpriteBatchContext context)

Parameters

time GameTime

The game's time

batch SpriteBatch

The sprite batch to use for drawing

alpha float

The alpha to draw this element and its children with

context SpriteBatchContext

The sprite batch context to use for drawing

TryClose(bool)

Closes this covering group, optionally displaying a closing animation. This method does nothing if the exit condition doesn't apply.

public void TryClose(bool closeFancy = true)

Parameters

closeFancy bool

Whether a closing animation should display. Note that, if UiAnimations is disabled, this value will be ignored.