Table of Contents

Class ScissorGroup

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

A scissor group is a Group that sets the Microsoft.Xna.Framework.Graphics.GraphicsDevice.ScissorRectangle before drawing its content (and thus, its Children), preventing them from being drawn outside of this group's DisplayArea's bounds.

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

Constructors

ScissorGroup(Anchor, Vector2, bool)

Creates a new scissor group with the given settings

public ScissorGroup(Anchor anchor, Vector2 size, bool setHeightBasedOnChildren = true)

Parameters

anchor Anchor

The group's anchor

size Vector2

The group's size

setHeightBasedOnChildren bool

Whether the group's height should be based on its children's height, see SetHeightBasedOnChildren.

ScissorGroup(Anchor, Vector2, bool, bool)

Creates a new scissor group with the given settings

public ScissorGroup(Anchor anchor, Vector2 size, bool setWidthBasedOnChildren, bool setHeightBasedOnChildren)

Parameters

anchor Anchor

The group's anchor

size Vector2

The group's size

setWidthBasedOnChildren bool

Whether the group's width should be based on its children's width, see SetWidthBasedOnChildren.

setHeightBasedOnChildren bool

Whether the group's height should be based on its children's height, see SetHeightBasedOnChildren.

Fields

Rasterizer

The rasterizer state that this scissor group should use when drawing. By default, Microsoft.Xna.Framework.Graphics.CullMode is set to Microsoft.Xna.Framework.Graphics.CullMode.CullCounterClockwiseFace in accordance with Microsoft.Xna.Framework.Graphics.SpriteBatch's default behavior, and Microsoft.Xna.Framework.Graphics.RasterizerState.ScissorTestEnable is set to true.

public readonly RasterizerState Rasterizer

Field Value

RasterizerState

Methods

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 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