Class ScissorGroup
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
AnchorThe group's anchor
size
Vector2The group's size
setHeightBasedOnChildren
boolWhether 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
AnchorThe group's anchor
size
Vector2The group's size
setWidthBasedOnChildren
boolWhether the group's width should be based on its children's width, see SetWidthBasedOnChildren.
setHeightBasedOnChildren
boolWhether 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
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