Neco/LandView/GraphicsEngine.cs
/// <summary>Draws a Plot label for a given plot</summary>
/// <param name="P">Plot to draw</param>
/// <param name="GRM">Graphcis to draw onto</param>
/// <param name="Origin">Point that defines 0,0 on the given graphics</param>
/// <param name="Background">Background color of the label</param>
/// <param name="Foreground">Foreground color of the label</param>
/// <param name="NameFont">Font used to draw the name</param>
/// <param name="InfoFont">Font used to draw the info</param>
Draws a Plot label for a given plot
Draws a Plot label for a given plot
public static void DrawPlotLabel(Plot P, Graphics GRM, Point Origin, Color Background, Color Foreground, Font NameFont, Font InfoFont) {
            if (P.GraphicalPoints.Length == 0) { return; } 
            Point PCenter = new(
                P.LeftmostX() + Origin.X + P.Width() / 2,
                P.TopmostY() + Origin.Y + P.Height() / 2);
            DrawLabel(GRM, PCenter, P.Name, $"{P.Area():n0}m²", Foreground, Background, NameFont, InfoFont, 2, 4);
        }
public static void DrawPlotLabel ( Plot P , Graphics GRM , Point Origin , Color Background , Color Foreground , Font NameFont , Font InfoFont ) { if ( P . GraphicalPoints . Length == 0 ) { return ; } Point PCenter = new ( P . LeftmostX ( ) + Origin . X + P . Width ( ) / 2 , P . TopmostY ( ) + Origin . Y + P . Height ( ) / 2 ) ; DrawLabel ( GRM , PCenter , P . Name , $" { P . Area ( ) : } m²" , oreground, ackground, ameFont, nfoFont, , ) ; }
Draws a Plot label for a given plot
Draws a Plot label for a given plot
//If it's less than 2 then we can't //Find the center of this thing //We're going to write some TEXT!
P
Plot
Plot to draw
Plot to draw
GRM
Graphics
Graphcis to draw onto
Graphcis to draw onto
Origin
Point
Point that defines 0,0 on the given graphics
Point that defines 0 0 on the given graphics
Background
Color
Background color of the label
Background color of the label
Foreground
Color
Foreground color of the label
Foreground color of the label
NameFont
Font
Font used to draw the name
Font used to draw the name
InfoFont
Font
Font used to draw the info
Font used to draw the info