public override void Draw(SpriteBatch batch) { for (int i = 0; i < drawAbleItems.Count; i++) { drawAbleItems[i].Draw(batch); } float yMargin = 0; if (player.Won) { Game1.Instance.fontRenderer.DrawText(batch, new Vector2(10, 10 + yMargin), "You win! It took you " + player.Tries + " Tries", Color.Black); backButton.Draw(batch); } if (testing) { Game1.Instance.fontRenderer.DrawText(batch, new Vector2(5, Game1.Instance.ScreenRect.Height - 40), "Testing... Press backspace to go back to editor", Color.Black); } if (paused) { RectangleRender.DrawFilled(batch, Game1.Instance.ScreenRect, Color.FromNonPremultiplied(0, 0, 0, 175)); pauseBack.Draw(batch); } pause.Draw(batch); base.Draw(batch); }
public void Draw(SpriteBatch batch) { if (level.Unlocked) { batch.Draw(previewImg, new Rectangle((int)position.X, (int)position.Y + 30, 256, 256), previewImg.Bounds, Color.White); Game1.Instance.fontRenderer.DrawText(batch, position + new Vector2(Game1.Instance.fontRenderer.StringSize(level.Name).Width, 0), level.Name); if (level.Beaten) { Game1.Instance.fontRenderer.DrawText(batch, position + new Vector2(5, 240), "Best " + level.Tries); } } else { batch.Draw(previewImg, new Rectangle((int)position.X, (int)position.Y + 30, 256, 256), previewImg.Bounds, Color.White); RectangleRender.DrawFilled(batch, new Rectangle((int)position.X, (int)position.Y + 30, 256, 256), Color.Black); Game1.Instance.fontRenderer.DrawText(batch, position + new Vector2(Game1.Instance.fontRenderer.StringSize(level.Name).Width, 0), level.Name); } }