Began trying to fix primitive batch. Added a default camera to the configuration.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using RecrownedAthenaeum.Input;
|
||||
using RecrownedAthenaeum.Render;
|
||||
using System;
|
||||
|
||||
namespace RecrownedAthenaeum.UI.Modular
|
||||
@@ -12,6 +13,16 @@ namespace RecrownedAthenaeum.UI.Modular
|
||||
/// </summary>
|
||||
public class UIModule : IInputListener
|
||||
{
|
||||
private RectangleRenderer renderer;
|
||||
private PrimitiveBatch primitiveBatch;
|
||||
|
||||
private bool debug = false;
|
||||
|
||||
/// <summary>
|
||||
/// Draws rectangle using the bounds of this module.
|
||||
/// </summary>
|
||||
public bool Debugging { set { if (value) { if (renderer == null) renderer = new RectangleRenderer(primitiveBatch = new PrimitiveBatch()); } else { primitiveBatch.Dispose(); primitiveBatch = null; renderer = null; } } get { return debug; } }
|
||||
|
||||
/// <summary>
|
||||
/// Bounds of this module.
|
||||
/// </summary>
|
||||
@@ -51,7 +62,7 @@ namespace RecrownedAthenaeum.UI.Modular
|
||||
/// <param name="batch">Batch used to draw.</param>
|
||||
public virtual void Draw(SpriteBatch batch)
|
||||
{
|
||||
|
||||
if (Debugging) { renderer.Begin(false); renderer.DrawRectangle(bounds.X, bounds.Y, bounds.Width, bounds.Height, Color.Red); renderer.End(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Reference in New Issue
Block a user