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