public override void Draw(Renderer renderer) { if (background != null) { background.Draw(renderer); } if (fadeSize.Y != Main.WindowHeight) { renderer.SetScissorRectangle((int)(Main.WindowWidth - fadeSize.X) / 2, (int)(Main.WindowHeight - fadeSize.Y) / 2, (int)fadeSize.X, (int)fadeSize.Y, false); } RenderHelper.SmartDrawRectangle(bg, 5, 0, 0, Main.WindowWidth, Main.WindowHeight, Color.White, renderer); for (int i = 0; i < controls.Count; i++) { controls[i].Draw(renderer); } if (fadeSize.X != Main.WindowWidth) { renderer.ResetScissorRectangle(); renderer.SetScissorRectangle((int)(Main.WindowWidth - fadeSize.X) / 2, (int)(Main.WindowHeight - fadeSize.Y) / 2, (int)fadeSize.X, (int)fadeSize.Y, false); } if (saves.ItemsCount() == 0) { var a = overlayFont.MeasureString("No save files found"); renderer.DrawString(overlayFont, "No save files found", new Rectangle(0, (int)(saves.Position.Y + (saves.Size.Y - a.Y) / 2), Main.WindowWidth, (int)a.Y), Color.Gray, Renderer.TextAlignment.Center); } if (fadeSize.X != Main.WindowWidth) { renderer.ResetScissorRectangle(); } }
public override void Draw(Renderer renderer) { base.Draw(renderer); if (saves.ItemsCount() == 0) { var a = overlayFont.MeasureString("No save files found"); renderer.DrawString(overlayFont, "No save files found", new Rectangle((int)saves.Position.X, (int)(saves.Position.Y + (saves.Size.Y - a.Y) / 2), (int)saves.Size.X, (int)a.Y), Color.Gray, Renderer.TextAlignment.Center); } }