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

46 lines
1.5 KiB
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RhythmBullet.Zer01HD.Game.Screens.Transitions;
using RhythmBullet.Zer01HD.UI;
using RhythmBullet.Zer01HD.Utilities.ContentSystem;
using RhythmBullet.Zer01HD.Utilities.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RhythmBullet.Zer01HD.Game.Screens
{
class MainScreen : Screen
{
Texture2D background;
FadeInTransition fadeInTransition;
public MainScreen(GraphicsDevice graphicsDevice, Color transitionFromColor, ContentSystem assets) : base(true)
{
fadeInTransition = new FadeInTransition(graphicsDevice, transitionFromColor);
background = assets.Get<Texture2D>("backgrounds/mainBG");
}
public override void Show()
{
fadeInTransition.Init(ScreenSize);
base.Show();
}
public override void Draw(SpriteBatch spriteBatch)
{
spriteBatch.Draw(background, ScreenSize, Color.White);
fadeInTransition.Draw(spriteBatch);
base.Draw(spriteBatch);
}
public override void EnteringTransition(double delta, bool assetsLoaded, ref Color backgroundColor, RenderTarget2D previousScreenExitFrame)
{
fadeInTransition.Fade((float)delta);
base.EnteringTransition(delta, assetsLoaded, ref backgroundColor, previousScreenExitFrame);
}
}
}