55 lines
1.5 KiB
C#
55 lines
1.5 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using RecrownedAthenaeum.Screens.Transitions;
|
|
using RecrownedAthenaeum.UI.Book;
|
|
using RecrownedAthenaeum.Camera;
|
|
using RecrownedAthenaeum.ContentSystem;
|
|
using RecrownedAthenaeum.ScreenSystem;
|
|
|
|
namespace RecrownedAthenaeum.Screens.MainMenu
|
|
{
|
|
class MainScreen : Screen
|
|
{
|
|
readonly ContentManagerController assets;
|
|
readonly FadeAwayTransition fat;
|
|
readonly Texture2D background;
|
|
readonly Book book;
|
|
readonly MainPage mainPage;
|
|
|
|
public MainScreen(ContentManagerController assets) : base(true)
|
|
{
|
|
this.assets = assets;
|
|
background = assets.Get<Texture2D>("backgrounds/mainBG");
|
|
fat = new FadeAwayTransition(1.5f);
|
|
book = new Book();
|
|
mainPage = new MainPage(assets);
|
|
book.AddPages(mainPage);
|
|
}
|
|
|
|
public override void Initiate(Rectangle screenSize, Camera2D camera)
|
|
{
|
|
book.Initiate(camera, screenSize);
|
|
base.Initiate(screenSize, camera);
|
|
}
|
|
|
|
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);
|
|
}
|
|
|
|
public override void Update(GameTime gameTime)
|
|
{
|
|
book.Update(gameTime);
|
|
base.Update(gameTime);
|
|
}
|
|
}
|
|
}
|