From e00f89325d43e73b12b0fb1e35513b20a71e6efc Mon Sep 17 00:00:00 2001 From: Recrown Date: Mon, 12 Nov 2018 19:54:33 -0600 Subject: [PATCH] added basic image ui module --- RhythmBullet/RhythmBullet.csproj | 3 ++- .../Zer01HD/Game/Screens/MainMenu/MainPage.cs | 17 +++++++----- .../Utilities/UI/Modular/Modules/Image.cs | 26 +++++++++++++++++++ .../UI/Modular/{ => Modules}/Text.cs | 2 +- 4 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 RhythmBullet/Zer01HD/Utilities/UI/Modular/Modules/Image.cs rename RhythmBullet/Zer01HD/Utilities/UI/Modular/{ => Modules}/Text.cs (95%) diff --git a/RhythmBullet/RhythmBullet.csproj b/RhythmBullet/RhythmBullet.csproj index b2fd93f..f572b1e 100644 --- a/RhythmBullet/RhythmBullet.csproj +++ b/RhythmBullet/RhythmBullet.csproj @@ -60,6 +60,7 @@ + @@ -67,7 +68,7 @@ - + diff --git a/RhythmBullet/Zer01HD/Game/Screens/MainMenu/MainPage.cs b/RhythmBullet/Zer01HD/Game/Screens/MainMenu/MainPage.cs index afdbe0a..2e9f03d 100644 --- a/RhythmBullet/Zer01HD/Game/Screens/MainMenu/MainPage.cs +++ b/RhythmBullet/Zer01HD/Game/Screens/MainMenu/MainPage.cs @@ -1,19 +1,22 @@ -using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using RhythmBullet.Zer01HD.UI.Book; using RhythmBullet.Zer01HD.Utilities.ContentSystem; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace RhythmBullet.Zer01HD.Game.Screens.MainMenu { internal class MainPage : Page { + Texture2D title; internal MainPage(ContentSystem assets, GraphicsDevice graphicsDevice) : base(0, 0, graphicsDevice) { - assets.Get("title"); + title = assets.Get("title"); + } + + public override void Draw(SpriteBatch batch) + { + batch.Draw(title, title.Bounds, Color.White); + base.Draw(batch); } } } diff --git a/RhythmBullet/Zer01HD/Utilities/UI/Modular/Modules/Image.cs b/RhythmBullet/Zer01HD/Utilities/UI/Modular/Modules/Image.cs new file mode 100644 index 0000000..4508b3f --- /dev/null +++ b/RhythmBullet/Zer01HD/Utilities/UI/Modular/Modules/Image.cs @@ -0,0 +1,26 @@ +using Microsoft.Xna.Framework.Graphics; +using RhythmBullet.Zer01HD.UI.Modular; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RhythmBullet.Zer01HD.Utilities.UI.Modular.Modules +{ + class Image : UIModule + { + Texture2D texture; + + public Image(Texture2D texture) + { + this.texture = texture; + } + + public override void Draw(SpriteBatch batch) + { + batch.Draw(texture, Bounds, Color); + base.Draw(batch); + } + } +} diff --git a/RhythmBullet/Zer01HD/Utilities/UI/Modular/Text.cs b/RhythmBullet/Zer01HD/Utilities/UI/Modular/Modules/Text.cs similarity index 95% rename from RhythmBullet/Zer01HD/Utilities/UI/Modular/Text.cs rename to RhythmBullet/Zer01HD/Utilities/UI/Modular/Modules/Text.cs index 68e3f3d..57e6227 100644 --- a/RhythmBullet/Zer01HD/Utilities/UI/Modular/Text.cs +++ b/RhythmBullet/Zer01HD/Utilities/UI/Modular/Modules/Text.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace RhythmBullet.Zer01HD.UI.Modular +namespace RhythmBullet.Zer01HD.UI.Modular.Modules { public class Text : UIModule {