rhythmbullet/RhythmBullet/Screens/MainMenu/MainScreen.cs

60 lines
1.7 KiB
C#
Raw Permalink Normal View History

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RecrownedAthenaeum.ContentSystem;
2019-03-09 06:50:46 +00:00
using RecrownedAthenaeum.Input;
using RecrownedAthenaeum.Render;
using RecrownedAthenaeum.UI.ScreenSystem;
2019-01-28 17:41:36 +00:00
using RecrownedAthenaeum.UI.BookSystem;
using RecrownedAthenaeum.UI.SkinSystem;
2019-01-23 01:31:15 +00:00
using RhythmBullet.Screens.Transitions;
2018-09-15 19:05:14 +00:00
2019-01-23 01:31:15 +00:00
namespace RhythmBullet.Screens.MainMenu
2018-09-15 19:05:14 +00:00
{
class MainScreen : Screen
{
readonly ContentManagerController assets;
readonly FadeAwayTransition fat;
readonly Texture2D background;
readonly Book book;
readonly MainPage mainPage;
Rectangle screenSize;
public MainScreen(ContentManagerController assets, ISkin skin, Camera2D camera) : base(true)
2018-09-15 19:05:14 +00:00
{
this.assets = assets;
fat = new FadeAwayTransition(1.5f);
book = new Book(assets, skin, camera);
2019-01-28 17:41:36 +00:00
mainPage = new MainPage();
2018-11-15 07:22:35 +00:00
book.AddPages(mainPage);
2019-03-09 06:50:46 +00:00
InputUtilities.InputListeners.Add(book);
2018-11-15 07:22:35 +00:00
}
public override void ApplySize(int width, int height)
2018-11-15 07:22:35 +00:00
{
screenSize.Width = width;
screenSize.Height = height;
book.ApplySize(width, height);
base.ApplySize(width, height);
2018-11-15 07:22:35 +00:00
}
public override void Show()
{
Transitions.Add(fat);
base.Show();
}
public override void Draw(ConsistentSpriteBatch spriteBatch)
{
spriteBatch.Draw(background, screenSize, Color.White);
book.Draw(spriteBatch);
base.Draw(spriteBatch);
2018-09-15 19:05:14 +00:00
}
public override void Update(GameTime gameTime)
{
book.Update(gameTime);
base.Update(gameTime);
}
2018-09-15 19:05:14 +00:00
}
}