58 lines
1.7 KiB
C#
58 lines
1.7 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using RecrownedAthenaeum.Camera;
|
|
using RecrownedAthenaeum.ContentSystem;
|
|
using RecrownedAthenaeum.Input;
|
|
using RecrownedAthenaeum.ScreenSystem;
|
|
using RecrownedAthenaeum.UI.BookSystem;
|
|
using RecrownedAthenaeum.UI.SkinSystem;
|
|
using RhythmBullet.Screens.Transitions;
|
|
|
|
namespace RhythmBullet.Screens.MainMenu
|
|
{
|
|
class MainScreen : Screen
|
|
{
|
|
readonly ContentManagerController assets;
|
|
readonly FadeAwayTransition fat;
|
|
readonly Texture2D background;
|
|
readonly Book book;
|
|
readonly MainPage mainPage;
|
|
|
|
public MainScreen(ContentManagerController assets, ISkin skin) : base(true)
|
|
{
|
|
this.assets = assets;
|
|
background = assets.Get<Texture2D>("backgrounds/mainBG");
|
|
fat = new FadeAwayTransition(1.5f);
|
|
book = new Book(assets, skin);
|
|
mainPage = new MainPage();
|
|
book.AddPages(mainPage);
|
|
InputUtilities.InputListeners.Add(book);
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|