Scissoring now works and implemented; Refactoring as well;

This commit is contained in:
2019-03-27 02:35:20 -05:00
parent b045033b25
commit d7ca521b9b
17 changed files with 129 additions and 119 deletions

View File

@@ -1,5 +1,4 @@
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input;
using RecrownedAthenaeum.SpecialTypes;
using RecrownedAthenaeum.Input;
using RecrownedAthenaeum.UI.SkinSystem.Definitions;

View File

@@ -1,5 +1,4 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using RecrownedAthenaeum.Input;
using RecrownedAthenaeum.Render;

View File

@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using RecrownedAthenaeum.Render;
@@ -18,18 +17,18 @@ namespace RecrownedAthenaeum.UI.Modular
/// <summary>
/// Set this to crop anything that flows out of the boundaries of this group. Will not crop if this is null.
/// </summary>
public ScissorBox scissorBox;
public BasicScissor basicScissor;
/// <summary>
/// Draws this group of modules. If scissoring, will use the matrix and effect designated in the <see cref="ScissorBox"/> to begin the batch normally again.
/// Draws this group of modules. If scissoring, will use the matrix and effect designated in the <see cref="BasicScissor"/> to begin the batch normally again.
/// </summary>
/// <param name="spriteBatch">Batch used to draw the group.</param>
public override void Draw(ConsistentSpriteBatch spriteBatch)
{
if (scissorBox != null)
if (basicScissor != null)
{
spriteBatch.End();
scissorBox.Begin(Boundaries, spriteBatch);
basicScissor.Begin(Boundaries, spriteBatch);
}
foreach (UIModule module in modules)
@@ -43,11 +42,9 @@ namespace RecrownedAthenaeum.UI.Modular
module.situation.Y = offsetY;
}
if (scissorBox != null)
if (basicScissor != null)
{
scissorBox.End();
GraphicsDevice graphics = spriteBatch.GraphicsDevice;
basicScissor.End();
spriteBatch.Begin();
}
}