rhythmbullet/RhythmBullet/Zer01HD/Game/Screens/MainMenu/MainScreen.cs

61 lines
1.7 KiB
C#
Raw Normal View History

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RhythmBullet.Zer01HD.Game.Screens.Transitions;
2018-09-15 19:05:14 +00:00
using RhythmBullet.Zer01HD.UI;
using RhythmBullet.Zer01HD.Utilities.ContentSystem;
using RhythmBullet.Zer01HD.Utilities.UI;
using RhythmBullet.Zer01HD.Utilities.ScreenSystem;
2018-09-15 19:05:14 +00:00
using System;
using System.Collections.Generic;
using System.Diagnostics;
2018-09-15 19:05:14 +00:00
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RhythmBullet.Zer01HD.UI.Book;
2018-11-15 07:22:35 +00:00
using RhythmBullet.Zer01HD.Utilities.Camera;
2018-09-15 19:05:14 +00:00
2018-11-13 00:50:00 +00:00
namespace RhythmBullet.Zer01HD.Game.Screens.MainMenu
2018-09-15 19:05:14 +00:00
{
class MainScreen : Screen
{
FadeAwayTransition fat;
Texture2D background;
Book book;
2018-11-15 07:22:35 +00:00
MainPage mainPage;
public MainScreen(ContentSystem assets) : base(true)
2018-09-15 19:05:14 +00:00
{
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(GraphicsDevice graphicsDevice, Rectangle screenSize, Camera2D camera)
{
book.Initiate(camera, screenSize);
base.Initiate(graphicsDevice, screenSize, camera);
}
public override void Show()
{
Transitions.Add(fat);
base.Show();
}
public override void Draw(SpriteBatch spriteBatch)
{
2018-11-15 07:22:35 +00:00
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
}
}