added basic image ui module

This commit is contained in:
Harrison Deng 2018-11-12 19:54:33 -06:00
parent 52c90498b9
commit e00f89325d
4 changed files with 39 additions and 9 deletions

View File

@ -60,6 +60,7 @@
<Compile Include="Zer01HD\Utilities\ScreenSystem\ITransition.cs" />
<Compile Include="Zer01HD\Utilities\ScreenSystem\LoadingScreen.cs" />
<Compile Include="Zer01HD\Game\Screens\MainMenu\MainScreen.cs" />
<Compile Include="Zer01HD\Utilities\UI\Modular\Modules\Image.cs" />
<Compile Include="Zer01HD\Utilities\UI\Modular\UIModule.cs" />
<Compile Include="Zer01HD\Utilities\UI\Modular\UIModuleGroup.cs" />
<Compile Include="RhythmBulletGame.cs" />
@ -67,7 +68,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Zer01HD\Utilities\UI\Book\Page.cs" />
<Compile Include="Zer01HD\Utilities\UI\Book\Book.cs" />
<Compile Include="Zer01HD\Utilities\UI\Modular\Text.cs" />
<Compile Include="Zer01HD\Utilities\UI\Modular\Modules\Text.cs" />
<Compile Include="Zer01HD\Utilities\ScreenSystem\Screen.cs" />
<Compile Include="Zer01HD\Utilities\ContentSystem\ContentLoad.cs" />
<Compile Include="Zer01HD\Game\ContentResolvers\FontContentResolver.cs" />

View File

@ -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<Texture2D>("title");
title = assets.Get<Texture2D>("title");
}
public override void Draw(SpriteBatch batch)
{
batch.Draw(title, title.Bounds, Color.White);
base.Draw(batch);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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
{