Class CoveringGroup
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
-
GenericDataHolderElementGroupCoveringGroup
- Implements
-
IGenericDataHolder
- Inherited Members
-
Element.EpsilonElement.ControlsElement.ScrollOffsetElement.TransformElement.SelectionIndicatorElement.ActionSoundElement.SecondActionSoundElement.PaddingElement.MouseEnterAnimationElement.MouseExitAnimationElement.OnDrawnElement.OnUpdatedElement.OnPressedElement.OnSecondaryPressedElement.OnSelectedElement.OnDeselectedElement.OnMouseEnterElement.OnMouseExitElement.OnTouchEnterElement.OnTouchExitElement.OnTextInputElement.OnAreaUpdatedElement.OnStyleInitElement.OnMousedElementChangedElement.OnTouchedElementChangedElement.OnSelectedElementChangedElement.GetTabNextElementElement.GetGamepadNextElementElement.OnChildAddedElement.OnChildRemovedElement.OnAddedToUiElement.OnRemovedFromUiElement.ChildrenElement.PlayingAnimationsElement.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.SystemElement.ParentElement.RootElement.ScaleElement.AnchorElement.SizeElement.ScaledSizeElement.AutoSizeAddedAbsoluteElement.ScaledAutoSizeAddedAbsoluteElement.PositionOffsetElement.ScaledOffsetElement.ScaledPaddingElement.ScaledChildPaddingElement.ChildPaddedAreaElement.UnscrolledAreaElement.AreaElement.DisplayAreaElement.ScaledScrollOffsetElement.IsHiddenElement.PriorityElement.CanBeSelectedElement.CanBeMousedElement.CanBePressedElement.CanAutoAnchorsAttachElement.SetWidthBasedOnChildrenElement.SetHeightBasedOnChildrenElement.TreatSizeAsMinimumElement.TreatSizeAsMaximumElement.PreventParentSpillElement.DrawAlphaElement.IsMouseOverElement.IsSelectedElement.IsSelectedActiveElement.AreaDirtyElement.AutoNavGroupElement.StyleElement.ChildPaddingElement.SortedChildrenElement.InputElement.ParentAreaGenericDataHolder.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
boolWhether 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
boolWhether a close button should be added to the first MLEM.Ui.Elements.Panel that is added as a child
openFancy
boolWhether 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
boolWhether 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
GameTimeThe game's time
batch
SpriteBatchThe sprite batch to use for drawing
alpha
floatThe alpha to draw this element and its children with
context
SpriteBatchContextThe 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
boolWhether a closing animation should display. Note that, if UiAnimations is disabled, this value will be ignored.