Camera isn't clamped to the top of the level, but there's a black rect that hides everything above the top "wall"

This commit is contained in:
Regalis
2016-08-05 14:06:54 +03:00
parent d55926a352
commit 9209e093d7
2 changed files with 8 additions and 1 deletions

View File

@@ -185,6 +185,13 @@ namespace Barotrauma
level.BackgroundColor, 0.0f,
Vector2.Zero,
SpriteEffects.None, 0.0f);
GUI.DrawRectangle(spriteBatch, new Rectangle((int)(MathUtils.Round(pos.X, 512.0f)), (int)-GameMain.GameScreen.Cam.WorldView.Y, width, (int)(GameMain.GameScreen.Cam.WorldView.Y - level.Size.Y)), Color.Black, true );
//background.DrawTiled(spriteBatch,
// (backgroundPos.Y < 0) ? new Vector2(0.0f, -backgroundPos.Y) : Vector2.Zero,
// new Vector2(GameMain.GraphicsWidth, 1024 - backgroundPos.Y),
// Vector2.Zero, level.BackgroundColor);
}

View File

@@ -156,7 +156,7 @@ namespace Barotrauma
public override void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch)
{
cam.UpdateTransform(true, !GameMain.DebugDraw);
cam.UpdateTransform(true);
DrawMap(graphics, spriteBatch);