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

46 lines
1.5 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;
2018-09-15 19:05:14 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RhythmBullet.Zer01HD.Game.Screens
2018-09-15 19:05:14 +00:00
{
class MainScreen : Screen
{
Texture2D background;
FadeInTransition fadeInTransition;
public MainScreen(GraphicsDevice graphicsDevice, Color transitionFromColor, ContentSystem assets) : base(true)
2018-09-15 19:05:14 +00:00
{
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);
2018-09-15 19:05:14 +00:00
}
public override void EnteringTransition(double delta, bool assetsLoaded, ref Color backgroundColor, RenderTarget2D previousScreenExitFrame)
{
fadeInTransition.Fade((float)delta);
base.EnteringTransition(delta, assetsLoaded, ref backgroundColor, previousScreenExitFrame);
}
2018-09-15 19:05:14 +00:00
}
}