Skip to content

LayeredScreenSurface Class

A basic console that can contain controls.

C#
[DataContract]
public class LayeredScreenSurface : ScreenSurface, IDisposable, IScreenSurfaceEditable, IScreenSurface, IScreenObject, IPositionable, IComponentHost, ISurface, ISurfaceSettable, ILayeredData, ICellSurfaceResize

Inheritance objectScreenObjectScreenSurface

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

Creates a new console.

C#
public LayeredScreenSurface(int width, int height)

width int
The width in cells of the surface.

height int
The height in cells of the surface.

LayeredScreenSurface(int, int, ColoredGlyphBase[])

Section titled “LayeredScreenSurface(int, int, ColoredGlyphBase[])”

Creates a new screen object that can render a surface. Uses the specified cells to generate the surface.

C#
public LayeredScreenSurface(int width, int height, ColoredGlyphBase[] initialCells)

width int
The width in cells of the surface.

height int
The height in cells of the surface.

initialCells ColoredGlyphBase[]
The initial cells to seed the surface.

Creates a new console with the specified width and height, with SadRogue.Primitives.Color.Transparent for the background and SadRogue.Primitives.Color.White for the foreground.

C#
public LayeredScreenSurface(int width, int height, int bufferWidth, int bufferHeight)

width int
The visible width of the console in cells.

height int
The visible height of the console in cells.

bufferWidth int
The total width of the console in cells.

bufferHeight int
The total height of the console in cells.

LayeredScreenSurface(int, int, int, int, ColoredGlyphBase[]?)

Section titled “LayeredScreenSurface(int, int, int, int, ColoredGlyphBase[]?)”

Creates a console with the specified width and height, with SadRogue.Primitives.Color.Transparent for the background and SadRogue.Primitives.Color.White for the foreground.

C#
public LayeredScreenSurface(int width, int height, int bufferWidth, int bufferHeight, ColoredGlyphBase[]? initialCells)

width int
The width of the console in cells.

height int
The height of the console in cells.

bufferWidth int
The total width of the console in cells.

bufferHeight int
The total height of the console in cells.

initialCells ColoredGlyphBase[]
The cells to seed the console with. If null, creates the cells for you.

LayeredScreenSurface(ICellSurface, IFont?, Point?)

Section titled “LayeredScreenSurface(ICellSurface, IFont?, Point?)”

Creates a new console using the existing surface.

C#
public LayeredScreenSurface(ICellSurface surface, IFont? font = null, Point? fontSize = null)

surface ICellSurface
The surface.

font IFont
The font to use with the surface.

fontSize System.NullableSadRogue.Primitives.Point
The font size.

The controls host holding all the controls.

C#
public LayeredSurface Layers { get; }

Resizes the surface to the specified width and height.

C#
public void Resize(int viewWidth, int viewHeight, int totalWidth, int totalHeight, bool clear)

viewWidth int
The viewable width of the surface.

viewHeight int
The viewable height of the surface.

totalWidth int
The maximum width of the surface.

totalHeight int
The maximum height of the surface.

clear bool
When true, resets every cell to the DefaultForeground, DefaultBackground and glyph 0.

Resizes the surface and view to the specified width and height.

C#
public void Resize(int width, int height, bool clear)

width int
The width of the surface and view.

height int
The height of the surface and view.

clear bool
When true, resets every cell to the DefaultForeground, DefaultBackground and glyph 0.

Returns the value “ScreenSurface (Layered)”.

C#
public override string ToString()

string
The string “ScreenSurface (Layered)”.