Skip to content

Border Class

Creates a 3D border around a surface.

C#
public class Border : ScreenSurface, IDisposable, IScreenSurfaceEditable, IScreenSurface, IScreenObject, IPositionable, IComponentHost, ISurface, ISurfaceSettable, ICellSurfaceResize

Inheritance objectScreenObjectScreenSurface

Implements IDisposable, IScreenSurfaceEditable, IScreenSurface, IScreenObject, SadRogue.Primitives.IPositionable, IComponentHost, ISurface, ISurfaceSettable, ICellSurfaceResize

Border(IScreenSurface, BorderParameters, IFont?)

Section titled “Border(IScreenSurface, BorderParameters, IFont?)”

Creates a border and adds it as a child object to contents.

C#
public Border(IScreenSurface contents, Border.BorderParameters parameters, IFont? font = null)

contents IScreenSurface
The object the border will be around.

parameters Border.BorderParameters
Border.BorderParameters to be used in creating the Border.

font IFont
Optional IFont for the border CellSurface.

Creates a border (with a shadow and a title) and adds it as a child object to contents.

C#
public Border(IScreenSurface contents, string title)

contents IScreenSurface
The object the border will be around.

title string
Title to display on the border.

Border(IScreenSurface, string, Color, Color)

Section titled “Border(IScreenSurface, string, Color, Color)”

Creates a border (with a shadow and a title) and adds it as a child object to contents.

C#
public Border(IScreenSurface contents, string title, Color textColor, Color borderColor)

contents IScreenSurface
The object the border will be around.

title string
Optional title to display on the border.

textColor SadRogue.Primitives.Color
Title text foreground color.

borderColor SadRogue.Primitives.Color
Border line foreground color and title text background color.

Creates a border and adds it as a child object to the window.

C#
public Border(Window contents)

contents Window
The window the border will be around.

Create3DForSurface(IScreenSurface, string, Color?, Color?, Color?, Color?, Color?)

Section titled “Create3DForSurface(IScreenSurface, string, Color?, Color?, Color?, Color?, Color?)”

Creates a chunky 3d border using SadConsole.ICellSurface.Connected3dBox glyphs.

C#
public static Border Create3DForSurface(IScreenSurface contents, string title, Color? titleForeground = null, Color? titleBackground = null, Color? borderBrightColor = null, Color? borderDarkColor = null, Color? borderBetweenColor = null)

contents IScreenSurface
The object the border will be around.

title string
Optional title to display on the border.

titleForeground System.NullableSadRogue.Primitives.Color
Foreground color of the title. Defaults to a brighter version of the content’s DefaultBackground.

titleBackground System.NullableSadRogue.Primitives.Color
Background color of the title. Defaults to the content’s DefaultForeground.

borderBrightColor System.NullableSadRogue.Primitives.Color
The bright color of the 3D border. Defaults to SadRogue.Primitives.Color.AnsiWhiteBright.

borderDarkColor System.NullableSadRogue.Primitives.Color
The dark color of the 3D border. Defaults to SadRogue.Primitives.Color.AnsiBlackBright.

borderBetweenColor System.NullableSadRogue.Primitives.Color
The corner color of the 3D border. Defaults to the content’s DefaultBackground.

Border
The created border, attached to the content.

For a nice looking border, set the content’s DefaultForeground to SadRogue.Primitives.Color.AnsiWhite and the DefaultBackground to SadRogue.Primitives.Color.AnsiBlue, before calling this method.

Helper method to add a border to a surface.

C#
public static void CreateForSurface(IScreenSurface contents, string title)

contents IScreenSurface
The object the border will be around.

title string
Optional title to display on the border.

Helper method to add a border to a window.

C#
public static void CreateForWindow(Window contents)

contents Window
The window the border will be around.