screens update normal logic during transition now; added comments; book now has an initiate function; image has more functions; minor improvements on module system;

This commit is contained in:
2018-11-15 01:22:19 -06:00
parent e00f89325d
commit 507cde744d
7 changed files with 82 additions and 23 deletions

View File

@@ -18,7 +18,7 @@ namespace RhythmBullet.Zer01HD.Utilities.ScreenSystem
public Color BackgroundColor;
public GraphicsDevice GraphicsDevice { get; private set; }
public Screen NextScreen { get; set; }
public Rectangle ScreenSize { get; protected set; }
public Rectangle ScreenSize { get; private set; }
public bool Initiated { get; private set; }
public Camera2D Camera { get; private set; }
public Screen(bool useEnterTransition = false)
@@ -27,7 +27,13 @@ namespace RhythmBullet.Zer01HD.Utilities.ScreenSystem
Transitions = new List<ITransition>();
}
public void Initiate(GraphicsDevice graphicsDevice, Rectangle screenSize, Camera2D camera)
/// <summary>
/// Called only once after initialization to give required parameters.
/// </summary>
/// <param name="graphicsDevice"></param>
/// <param name="screenSize"></param>
/// <param name="camera"></param>
public virtual void Initiate(GraphicsDevice graphicsDevice, Rectangle screenSize, Camera2D camera)
{
this.Camera = camera;
this.ScreenSize = screenSize;
@@ -100,6 +106,9 @@ namespace RhythmBullet.Zer01HD.Utilities.ScreenSystem
return complete;
}
/// <summary>
/// Called when the screen is shown.
/// </summary>
public virtual void Show()
{
foreach (ITransition transition in Transitions)

View File

@@ -87,10 +87,8 @@ namespace RhythmBullet.Zer01HD.Utilities.ScreenSystem
}
}
break;
case ScreenState.Normal:
Screen.Update(gameTime);
break;
}
Screen.Update(gameTime);
}
public void DrawCurrentScreen(SpriteBatch spriteBatch)