Clean up and progress on buttons.

This commit is contained in:
Harrison Deng 2019-03-05 21:42:28 -06:00
parent d346f7c729
commit e19f6be719
5 changed files with 9 additions and 10 deletions

View File

@ -97,6 +97,7 @@ namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive
upTexture.Draw(batch, bounds, color);
}
}
base.Draw(batch);
}

View File

@ -3,6 +3,7 @@ using Microsoft.Xna.Framework.Graphics;
using RecrownedAthenaeum.SpecialTypes;
using RecrownedAthenaeum.UI.SkinSystem;
using RecrownedAthenaeum.UI.SkinSystem.Definitions;
using System;
namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive
{
@ -47,6 +48,7 @@ namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive
{
TextButtonSkinDefinition skinDefinition = skin.ObtainDefinition<TextButtonSkinDefinition>(definitionName);
this.text = new Text(font, text);
this.text.autoScale = true;
FontColor = skin.GetColor(skinDefinition.fontColor);
}
@ -74,6 +76,7 @@ namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive
{
text.bounds = bounds;
text.Update(gameTime);
text.CenterIn(TrueBounds);
base.Update(gameTime);
}
@ -83,8 +86,8 @@ namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive
/// <param name="batch">Batch to use. Batch should already be started.</param>
public override void Draw(SpriteBatch batch)
{
text.Draw(batch);
base.Draw(batch);
text.Draw(batch);
}
}
}

View File

@ -28,7 +28,7 @@ namespace RecrownedAthenaeum.UI.Modular
/// <summary>
/// Bounds of this module (after factoring in the origin).
/// </summary>
public Rectangle ActualBounds
public Rectangle TrueBounds
{
get
{
@ -74,7 +74,7 @@ namespace RecrownedAthenaeum.UI.Modular
if (Debugging)
{
rectangleRenderer.Begin();
rectangleRenderer.Draw(ActualBounds.X, ActualBounds.Y, ActualBounds.Width, ActualBounds.Height, Color.Red);
rectangleRenderer.Draw(TrueBounds.X, TrueBounds.Y, TrueBounds.Width, TrueBounds.Height, Color.Red);
rectangleRenderer.End();
}
}

View File

@ -5,7 +5,7 @@ namespace RecrownedAthenaeum.UI.SkinSystem.Definitions
/// <summary>
/// A definition containing the data for the skin system. Needs to follow data transfer object model.
/// </summary>
public class SkinDefinitionData
public abstract class SkinDefinitionData
{
/// <summary>
/// The full name of the UI module this definition defines.

View File

@ -43,11 +43,6 @@ namespace RecrownedAthenaeum.Camera
/// </summary>
public Matrix projectionMatrix;
/// <summary>
/// The final transformation matrix.
/// </summary>
public Matrix TransformationMatrix { get; private set; }
/// <summary>
/// The graphics device used
/// </summary>
@ -74,6 +69,7 @@ namespace RecrownedAthenaeum.Camera
BasicEffect = new BasicEffect(graphicsDevice);
BasicEffect.TextureEnabled = true;
BasicEffect.VertexColorEnabled = true;
Apply();
}
@ -83,7 +79,6 @@ namespace RecrownedAthenaeum.Camera
public virtual void Apply()
{
ViewMatrix = Matrix.CreateLookAt(position, lookAt, upDirection);
TransformationMatrix = projectionMatrix * ViewMatrix * worldMatrix;
BasicEffect.World = worldMatrix;
BasicEffect.View = ViewMatrix;