|
@ -95,15 +95,23 @@ namespace SemiColinGames { |
|
|
Debug.Draw(graphics, basicEffect); |
|
|
Debug.Draw(graphics, basicEffect); |
|
|
|
|
|
|
|
|
// Draw in-world UI on top of everything.
|
|
|
// Draw in-world UI on top of everything.
|
|
|
if (paused) { |
|
|
|
|
|
spriteBatch.Begin( |
|
|
spriteBatch.Begin( |
|
|
SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, null); |
|
|
SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, null); |
|
|
|
|
|
for (int i = 0; i < player.MaxHealth; i++) { |
|
|
|
|
|
Vector2 pos = new Vector2(16 + 16 * i, 8); |
|
|
|
|
|
if (player.Health > i) { |
|
|
|
|
|
spriteBatch.Draw(Textures.Heart.Get, pos, new Rectangle(0, 0, 16, 16), Color.White); |
|
|
|
|
|
} else { |
|
|
|
|
|
spriteBatch.Draw(Textures.Heart.Get, pos, new Rectangle(16, 0, 16, 16), Color.White); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (paused) { |
|
|
string text = "Paused"; |
|
|
string text = "Paused"; |
|
|
Vector2 position = Textures.BannerFont.CenteredOn(text, camera.HalfSize); |
|
|
Vector2 position = Textures.BannerFont.CenteredOn(text, camera.HalfSize); |
|
|
Text.DrawOutlined(spriteBatch, Textures.BannerFont, text, position, Color.White); |
|
|
Text.DrawOutlined(spriteBatch, Textures.BannerFont, text, position, Color.White); |
|
|
spriteBatch.End(); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
spriteBatch.End(); |
|
|
|
|
|
|
|
|
// Get ready to draw sceneTarget to screen.
|
|
|
// Get ready to draw sceneTarget to screen.
|
|
|
graphics.SetRenderTarget(null); |
|
|
graphics.SetRenderTarget(null); |
|
@ -124,7 +132,7 @@ namespace SemiColinGames { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Actually draw to screen.
|
|
|
// Actually draw to screen.
|
|
|
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, |
|
|
|
|
|
|
|
|
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, |
|
|
SamplerState.PointClamp, DepthStencilState.Default, |
|
|
SamplerState.PointClamp, DepthStencilState.Default, |
|
|
RasterizerState.CullNone); |
|
|
RasterizerState.CullNone); |
|
|
spriteBatch.Draw(sceneTarget, drawRect, Color.White); |
|
|
spriteBatch.Draw(sceneTarget, drawRect, Color.White); |
|
|