public override void OnDraw() { Graphic.Clear(); Graphic.FitSizesToWindow(); var temp1 = GetSafePixelsList(paintPixels); for (int i = 0; i < temp1.Count; i++) { Graphic.Add(temp1[i].Char.ToString(), temp1[i].Position, temp1[i].Color); } var temp2 = GetSafePixelsList(tempPixels); for (int i = 0; i < temp2.Count; i++) { Graphic.Add(temp2[i].Char.ToString(), temp2[i].Position, temp2[i].Color); } temp2.Clear(); if (justSaved || justLoaded) { if (justSaved) { Graphic.AddRectangle(" ", new Colors(Colors.Color.Default, Colors.Color.Green), new Coords(3, 2), new Coords(Graphic.Width - 4, Graphic.Height - 3)); justSaved = false; } if (justLoaded) { Graphic.AddRectangle(" ", new Colors(Colors.Color.Default, Colors.Color.Gray), new Coords(3, 2), new Coords(Graphic.Width - 4, Graphic.Height - 3)); justLoaded = false; } } drawInterface(); drawHelp(); drawDebug(); if (MousePosition.IsInRectangle(new Coords(3, 2), new Coords(Graphic.Width - 4, Graphic.Height - 3))) { Graphic.Add(" ", MousePosition, brush.BrushColor); } Graphic.Draw(); }
void drawDebug() { if (!showDebug) { return; } Graphic.AddRectangle(" ", Colors.Default, new Coords(2, 1), new Coords(27, 7)); Graphic.AddRectangleBorder("═", "│", "─", "║", "╔", "╤", "┘", "╟", Colors.Default, new Coords(2, 1), new Coords(27, 7)); Graphic.Add($"Tick rate: .....: {CurrentTickRate}/{TickRate}", new Coords(3, 2)); Graphic.Add($"Frame rate: ....: {CurrentFrameRate}/{FrameRate}", new Coords(3, 3)); Graphic.Add($"Draw calls: ....: {Graphic.LastDrawCallsCount}", new Coords(3, 4)); Graphic.Add($"Pixels painted .: {paintPixels.Count}", new Coords(3, 5)); Graphic.Add($"Pixels in temp .: {tempPixels.Count}", new Coords(3, 6)); Graphic.SetOrigin(Origin.Default); }
void drawHelp() { if (!showHelp) { return; } Graphic.SetOrigin(new Origin(Origin.HorizontalOrigin.Center, Origin.VerticalOrigin.Middle)); Graphic.AddRectangle(" ", Colors.Default, new Coords(0, -5), new Coords(30, 4)); Graphic.AddRectangleBorder("═", "║", "═", "║", "╔", "╗", "╝", "╚", Colors.Default, new Coords(-15, -5), new Coords(15, 4)); Graphic.Add("Terminal Paint v1.0 100", new Coords(0, -3)); Graphic.Add("by KostarSf", new Coords(0, -2)); Graphic.Add("powered by", new Coords(0, 1)); Graphic.Add("StripedEngine", new Coords(0, 2)); Graphic.SetOrigin(Origin.Default); }