title now displayed
This commit is contained in:
@@ -2,20 +2,29 @@
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using RhythmBullet.Zer01HD.UI.Book;
|
||||
using RhythmBullet.Zer01HD.Utilities.ContentSystem;
|
||||
using RhythmBullet.Zer01HD.Utilities.UI.Modular.Modules;
|
||||
|
||||
namespace RhythmBullet.Zer01HD.Game.Screens.MainMenu
|
||||
{
|
||||
internal class MainPage : Page
|
||||
{
|
||||
Texture2D title;
|
||||
internal MainPage(ContentSystem assets, GraphicsDevice graphicsDevice) : base(0, 0, graphicsDevice)
|
||||
Image title;
|
||||
internal MainPage(ContentSystem assets) : base(0, 0)
|
||||
{
|
||||
title = assets.Get<Texture2D>("title");
|
||||
title = new Image(assets.Get<Texture2D>("title"));
|
||||
AddModule(title);
|
||||
}
|
||||
|
||||
public override void ApplySize(int width, int height)
|
||||
{
|
||||
title.Scale = (width - 40) / title.Texture.Width;
|
||||
title.Bounds.X = (int)((width - title.Bounds.Width) / 2f);
|
||||
title.Bounds.Y = (int)((height - title.Bounds.Height) / 2f);
|
||||
base.ApplySize(width, height);
|
||||
}
|
||||
|
||||
public override void Draw(SpriteBatch batch)
|
||||
{
|
||||
batch.Draw(title, title.Bounds, Color.White);
|
||||
base.Draw(batch);
|
||||
}
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using RhythmBullet.Zer01HD.UI.Book;
|
||||
using RhythmBullet.Zer01HD.Utilities.Camera;
|
||||
|
||||
namespace RhythmBullet.Zer01HD.Game.Screens.MainMenu
|
||||
{
|
||||
@@ -20,12 +21,21 @@ namespace RhythmBullet.Zer01HD.Game.Screens.MainMenu
|
||||
FadeAwayTransition fat;
|
||||
Texture2D background;
|
||||
Book book;
|
||||
MainPage mainPage;
|
||||
public MainScreen(ContentSystem assets) : base(true)
|
||||
{
|
||||
background = assets.Get<Texture2D>("backgrounds/mainBG");
|
||||
fat = new FadeAwayTransition(1.5f);
|
||||
book = new Book(Camera);
|
||||
}
|
||||
book = new Book();
|
||||
mainPage = new MainPage(assets);
|
||||
book.AddPages(mainPage);
|
||||
}
|
||||
|
||||
public override void Initiate(GraphicsDevice graphicsDevice, Rectangle screenSize, Camera2D camera)
|
||||
{
|
||||
book.Initiate(camera, screenSize);
|
||||
base.Initiate(graphicsDevice, screenSize, camera);
|
||||
}
|
||||
|
||||
public override void Show()
|
||||
{
|
||||
@@ -35,6 +45,7 @@ namespace RhythmBullet.Zer01HD.Game.Screens.MainMenu
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch)
|
||||
{
|
||||
|
||||
spriteBatch.Draw(background, ScreenSize, Color.White);
|
||||
book.Draw(spriteBatch);
|
||||
base.Draw(spriteBatch);
|
||||
|
@@ -22,7 +22,7 @@ namespace RhythmBullet.Zer01HD.UI.Book
|
||||
/// </summary>
|
||||
/// <param name="camera">Camera game is currently using.</param>
|
||||
/// <param name="dimensions">Dimensions of the book and the dimensions the pages will use.</param>
|
||||
public void Initialize(Camera2D camera, Rectangle dimensions)
|
||||
public void Initiate(Camera2D camera, Rectangle dimensions)
|
||||
{
|
||||
this.camera = camera;
|
||||
this.dimensions = dimensions;
|
||||
|
Reference in New Issue
Block a user