smoothed out black to white transition on splash screen
This commit is contained in:
@@ -131,6 +131,7 @@ namespace RhythmBullet.Zer01HD.Utilities.ContentSystem
|
||||
contentManager.Unload();
|
||||
assets.Clear();
|
||||
ClearQueue();
|
||||
Debug.WriteLine("Unloaded all assets.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -12,15 +12,18 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace RhythmBullet.Zer01HD.Game
|
||||
{
|
||||
class SplashScreen : Screen
|
||||
class LoadingScreen : Screen
|
||||
{
|
||||
Texture2D recrown;
|
||||
Color color;
|
||||
Rectangle rectangleBounds;
|
||||
float proportion = 0.4f;
|
||||
RhythmBulletGame rhythmBullet;
|
||||
float progress;
|
||||
public SplashScreen(RhythmBulletGame rhythmBullet, Rectangle dimensions)
|
||||
double progress;
|
||||
double timePassed;
|
||||
public LoadingScreen(RhythmBulletGame rhythmBullet, Rectangle dimensions)
|
||||
{
|
||||
color = Color.White;
|
||||
this.recrown = rhythmBullet.Content.Load<Texture2D>("RhythmBullet");
|
||||
this.rhythmBullet = rhythmBullet;
|
||||
rectangleBounds = new Rectangle(0, 0, (int)(dimensions.Height * proportion), (int)(dimensions.Height * proportion));
|
||||
@@ -31,13 +34,14 @@ namespace RhythmBullet.Zer01HD.Game
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (progress < 0.8f)
|
||||
if (progress < 1f)
|
||||
{
|
||||
float delta = (float) gameTime.ElapsedGameTime.TotalSeconds;
|
||||
progress += (delta/6f);
|
||||
if (progress > 1f)
|
||||
double delta = gameTime.ElapsedGameTime.TotalSeconds;
|
||||
timePassed += delta;
|
||||
progress = timePassed / 4;
|
||||
if (progress > 0.9f)
|
||||
{
|
||||
progress = 1f;
|
||||
progress = 0.9f;
|
||||
}
|
||||
rhythmBullet.BackgroundColor.R = (byte)(progress * 255);
|
||||
rhythmBullet.BackgroundColor.G = (byte)(progress * 255);
|
||||
@@ -49,7 +53,7 @@ namespace RhythmBullet.Zer01HD.Game
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch)
|
||||
{
|
||||
spriteBatch.Draw(recrown, rectangleBounds, Color.White);
|
||||
spriteBatch.Draw(recrown, rectangleBounds, color);
|
||||
base.Draw(spriteBatch);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user