rhythmbullet/RhythmBullet/Screens/MainMenu/MainScreen.cs

55 lines
1.5 KiB
C#
Raw Normal View History

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RecrownedAthenaeum.Camera;
using RecrownedAthenaeum.ContentSystem;
using RecrownedAthenaeum.ScreenSystem;
2019-01-23 01:31:15 +00:00
using RecrownedAthenaeum.UI.Book;
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;
public MainScreen(ContentManagerController assets) : base(true)
2018-09-15 19:05:14 +00:00
{
this.assets = assets;
background = assets.Get<Texture2D>("backgrounds/mainBG");
fat = new FadeAwayTransition(1.5f);
2018-11-15 07:22:35 +00:00
book = new Book();
mainPage = new MainPage(assets);
book.AddPages(mainPage);
}
public override void Initiate(Rectangle screenSize, Camera2D camera)
2018-11-15 07:22:35 +00:00
{
book.Initiate(camera, screenSize);
base.Initiate(screenSize, camera);
2018-11-15 07:22:35 +00:00
}
public override void Show()
{
Transitions.Add(fat);
base.Show();
}
public override void Draw(SpriteBatch 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
}
}