C# Class Nez.ScissorStack

A stack of Rectangle objects to be used for clipping via GraphicsDevice.ScissorRectangle. When a new Rectangle is pushed onto the stack, it will be merged with the current top of stack.The minimum area of overlap is then set as the real top of the stack.
Show file Open project: prime31/Nez

Public Methods

Method Description
calculateScissors ( Camera camera, Matrix batchTransform, Rectangle scissor ) : Rectangle

Calculates a screen space scissor rectangle using the given Camera. If the Camera is null than the scissor will be calculated only with the batchTransform

calculateScissors ( Camera camera, Matrix2D batchTransform, Rectangle scissor ) : Rectangle

Calculates a screen space scissor rectangle using the given Camera. If the Camera is null than the scissor will be calculated only with the batchTransform

popScissors ( ) : Rectangle

Pops the current scissor rectangle from the stack and sets the new scissor area to the new top of stack rectangle. Any drawing should be flushed before popping scissors.

pushScissors ( Rectangle scissor ) : bool

Method Details

calculateScissors() public static method

Calculates a screen space scissor rectangle using the given Camera. If the Camera is null than the scissor will be calculated only with the batchTransform
public static calculateScissors ( Camera camera, Matrix batchTransform, Rectangle scissor ) : Rectangle
camera Camera Camera.
batchTransform Matrix Batch transform.
scissor Microsoft.Xna.Framework.Rectangle Area.
return Microsoft.Xna.Framework.Rectangle

calculateScissors() public static method

Calculates a screen space scissor rectangle using the given Camera. If the Camera is null than the scissor will be calculated only with the batchTransform
public static calculateScissors ( Camera camera, Matrix2D batchTransform, Rectangle scissor ) : Rectangle
camera Camera Camera.
batchTransform Matrix2D Batch transform.
scissor Microsoft.Xna.Framework.Rectangle Area.
return Microsoft.Xna.Framework.Rectangle

popScissors() public static method

Pops the current scissor rectangle from the stack and sets the new scissor area to the new top of stack rectangle. Any drawing should be flushed before popping scissors.
public static popScissors ( ) : Rectangle
return Microsoft.Xna.Framework.Rectangle

pushScissors() public static method

public static pushScissors ( Rectangle scissor ) : bool
scissor Microsoft.Xna.Framework.Rectangle
return bool