refactor: removed dash from project name and underscore from namespaces. Began working on pipeline project.

This commit is contained in:
2018-12-04 19:19:31 -06:00
parent 52fa550ced
commit 151480eaee
40 changed files with 316 additions and 114 deletions

View File

@@ -0,0 +1,62 @@
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using RecrownedAthenaeum.UI.Modular;
using RecrownedAthenaeum.DataTypes;
using RecrownedAthenaeum.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive
{
public delegate bool Clicked();
public class Button : UIModule
{
private NinePatch background;
public event Clicked Listeners;
public Button(NinePatch background = null)
{
this.background = background;
}
public override void Draw(SpriteBatch batch)
{
background?.Draw(batch, bounds);
base.Draw(batch);
}
public sealed override bool MouseStateChanged(MouseState state)
{
if (InputUtilities.MouseWithinBoundries(bounds))
{
if (InputUtilities.MouseClicked())
{
OnClick();
}
Highlighted = true;
}
else
{
Highlighted = false;
}
return base.MouseStateChanged(state);
}
public sealed override bool KeyboardStateChanged(KeyboardState state)
{
return base.KeyboardStateChanged(state);
}
protected void OnClick()
{
Listeners?.Invoke();
}
public bool Highlighted { get; private set; }
}
}

View File

@@ -0,0 +1,37 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RecrownedAthenaeum.UI.Modular.Modules;
using RecrownedAthenaeum.DataTypes;
using RecrownedAthenaeum.UI.Modular.Modules.Interactive;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive
{
public class TextButton : Button
{
private TextLabel label;
public TextButton(string text, SpriteFont font, NinePatch background) : base(background)
{
label = new TextLabel(font, text);
label.autoScale = true;
}
public override void Update(GameTime gameTime)
{
label.bounds = bounds;
label.Update(gameTime);
base.Update(gameTime);
}
public override void Draw(SpriteBatch batch)
{
label.Draw(batch);
base.Draw(batch);
}
}
}