Console Class
Definition
Section titled “Definition”A surface that has a cursor.
[DataContract][JsonObject(MemberSerialization = MemberSerialization.OptIn)]public class Console : ScreenSurface, IDisposable, IScreenSurfaceEditable, IScreenSurface, IScreenObject, IPositionable, IComponentHost, ISurface, ISurfaceSettable, ICellSurfaceResizeInheritance object → ScreenObject → ScreenSurface
Implements IDisposable, IScreenSurfaceEditable, IScreenSurface, IScreenObject, SadRogue.Primitives.IPositionable, IComponentHost, ISurface, ISurfaceSettable, ICellSurfaceResize
Constructors
Section titled “Constructors”Console(int, int)
Section titled “Console(int, int)”Creates a new console.
public Console(int width, int height)Parameters
Section titled “Parameters”width int
The width in cells of the surface.
height int
The height in cells of the surface.
Console(int, int, ColoredGlyphBase[])
Section titled “Console(int, int, ColoredGlyphBase[])”Creates a new screen object that can render a surface. Uses the specified cells to generate the surface.
public Console(int width, int height, ColoredGlyphBase[] initialCells)Parameters
Section titled “Parameters”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.
Console(int, int, int, int)
Section titled “Console(int, int, int, int)”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.
public Console(int width, int height, int bufferWidth, int bufferHeight)Parameters
Section titled “Parameters”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.
Console(int, int, int, int, ColoredGlyphBase[]?)
Section titled “Console(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.
public Console(int width, int height, int bufferWidth, int bufferHeight, ColoredGlyphBase[]? initialCells)Parameters
Section titled “Parameters”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.
Console(ICellSurface, IFont?, Point?)
Section titled “Console(ICellSurface, IFont?, Point?)”Creates a new console using the existing surface.
public Console(ICellSurface surface, IFont? font = null, Point? fontSize = null)Parameters
Section titled “Parameters”surface ICellSurface
The surface.
font IFont
The font to use with the surface.
fontSize System.NullableSadRogue.Primitives.Point
The font size.
Properties
Section titled “Properties”Cursor
Section titled “Cursor”The virtual cursor reference.
public Cursor Cursor { get; protected set; }AutoCursorOnFocus
Section titled “AutoCursorOnFocus”Toggles the cursor as visible\hidden when the console if focused\unfocused.
[DataMember]public bool AutoCursorOnFocus { get; set; }Methods
Section titled “Methods”OnVisibleChanged()
Section titled “OnVisibleChanged()”Called when the visibility of the object changes.
protected override void OnVisibleChanged()OnFocusLost()
Section titled “OnFocusLost()”Called when this console’s focus has been lost. Hides the Cursor if AutoCursorOnFocus is true.
public override void OnFocusLost()OnFocused()
Section titled “OnFocused()”Called when this console is focused. Shows the Cursor if AutoCursorOnFocus is true.
public override void OnFocused()ToString()
Section titled “ToString()”Returns the value “Console”.
public override string ToString()Returns
Section titled “Returns”string
The string “Console”.