title now displayed
This commit is contained in:
parent
507cde744d
commit
8377bb5ae8
@ -30,7 +30,7 @@ namespace RhythmBullet
|
|||||||
readonly ResolutionContentResolver resolutionContentResolver;
|
readonly ResolutionContentResolver resolutionContentResolver;
|
||||||
public PreferencesManager preferencesManager;
|
public PreferencesManager preferencesManager;
|
||||||
private ScreenManager screenManager;
|
private ScreenManager screenManager;
|
||||||
private Camera2D camera;
|
public Camera2D Camera { get; private set; }
|
||||||
private bool resizing;
|
private bool resizing;
|
||||||
|
|
||||||
public RhythmBulletGame()
|
public RhythmBulletGame()
|
||||||
@ -75,8 +75,8 @@ namespace RhythmBullet
|
|||||||
{
|
{
|
||||||
// Create a new SpriteBatch, which can be used to draw textures.
|
// Create a new SpriteBatch, which can be used to draw textures.
|
||||||
spriteBatch = new SpriteBatch(GraphicsDevice);
|
spriteBatch = new SpriteBatch(GraphicsDevice);
|
||||||
camera = new Camera2D(graphics.GraphicsDevice);
|
Camera = new Camera2D(graphics.GraphicsDevice);
|
||||||
screenManager = new ScreenManager(graphics, camera);
|
screenManager = new ScreenManager(graphics, Camera);
|
||||||
screenManager.RequireNextScreenEvent += ExitTransitionComplete;
|
screenManager.RequireNextScreenEvent += ExitTransitionComplete;
|
||||||
QueueContent();
|
QueueContent();
|
||||||
screenManager.Screen = new LoadingScreen(Content.Load<Texture2D>("RhythmBullet"), 0.7f);
|
screenManager.Screen = new LoadingScreen(Content.Load<Texture2D>("RhythmBullet"), 0.7f);
|
||||||
@ -111,7 +111,7 @@ namespace RhythmBullet
|
|||||||
screenManager.UpdateCurrentScreen(gameTime, Assets.Done);
|
screenManager.UpdateCurrentScreen(gameTime, Assets.Done);
|
||||||
|
|
||||||
InputUtilities.Update();
|
InputUtilities.Update();
|
||||||
camera.Update();
|
Camera.Update();
|
||||||
base.Update(gameTime);
|
base.Update(gameTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,20 +2,29 @@
|
|||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using RhythmBullet.Zer01HD.UI.Book;
|
using RhythmBullet.Zer01HD.UI.Book;
|
||||||
using RhythmBullet.Zer01HD.Utilities.ContentSystem;
|
using RhythmBullet.Zer01HD.Utilities.ContentSystem;
|
||||||
|
using RhythmBullet.Zer01HD.Utilities.UI.Modular.Modules;
|
||||||
|
|
||||||
namespace RhythmBullet.Zer01HD.Game.Screens.MainMenu
|
namespace RhythmBullet.Zer01HD.Game.Screens.MainMenu
|
||||||
{
|
{
|
||||||
internal class MainPage : Page
|
internal class MainPage : Page
|
||||||
{
|
{
|
||||||
Texture2D title;
|
Image title;
|
||||||
internal MainPage(ContentSystem assets, GraphicsDevice graphicsDevice) : base(0, 0, graphicsDevice)
|
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)
|
public override void Draw(SpriteBatch batch)
|
||||||
{
|
{
|
||||||
batch.Draw(title, title.Bounds, Color.White);
|
|
||||||
base.Draw(batch);
|
base.Draw(batch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using RhythmBullet.Zer01HD.UI.Book;
|
using RhythmBullet.Zer01HD.UI.Book;
|
||||||
|
using RhythmBullet.Zer01HD.Utilities.Camera;
|
||||||
|
|
||||||
namespace RhythmBullet.Zer01HD.Game.Screens.MainMenu
|
namespace RhythmBullet.Zer01HD.Game.Screens.MainMenu
|
||||||
{
|
{
|
||||||
@ -20,12 +21,21 @@ namespace RhythmBullet.Zer01HD.Game.Screens.MainMenu
|
|||||||
FadeAwayTransition fat;
|
FadeAwayTransition fat;
|
||||||
Texture2D background;
|
Texture2D background;
|
||||||
Book book;
|
Book book;
|
||||||
|
MainPage mainPage;
|
||||||
public MainScreen(ContentSystem assets) : base(true)
|
public MainScreen(ContentSystem assets) : base(true)
|
||||||
{
|
{
|
||||||
background = assets.Get<Texture2D>("backgrounds/mainBG");
|
background = assets.Get<Texture2D>("backgrounds/mainBG");
|
||||||
fat = new FadeAwayTransition(1.5f);
|
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()
|
public override void Show()
|
||||||
{
|
{
|
||||||
@ -35,6 +45,7 @@ namespace RhythmBullet.Zer01HD.Game.Screens.MainMenu
|
|||||||
|
|
||||||
public override void Draw(SpriteBatch spriteBatch)
|
public override void Draw(SpriteBatch spriteBatch)
|
||||||
{
|
{
|
||||||
|
|
||||||
spriteBatch.Draw(background, ScreenSize, Color.White);
|
spriteBatch.Draw(background, ScreenSize, Color.White);
|
||||||
book.Draw(spriteBatch);
|
book.Draw(spriteBatch);
|
||||||
base.Draw(spriteBatch);
|
base.Draw(spriteBatch);
|
||||||
|
@ -22,7 +22,7 @@ namespace RhythmBullet.Zer01HD.UI.Book
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="camera">Camera game is currently using.</param>
|
/// <param name="camera">Camera game is currently using.</param>
|
||||||
/// <param name="dimensions">Dimensions of the book and the dimensions the pages will use.</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.camera = camera;
|
||||||
this.dimensions = dimensions;
|
this.dimensions = dimensions;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user