Class ColoredGlyphBase
Represents an individual piece of a ICellSurface containing a glyph, foreground color, background color, and a mirror effect.
Implements
Inherited Members
Namespace: SadConsole
Assembly: SadConsole.dll
Syntax
public abstract class ColoredGlyphBase : IMatchable<ColoredGlyphBase>
Constructors
ColoredGlyphBase()
Declaration
protected ColoredGlyphBase()
Properties
Background
The background color of this cell.
Declaration
public Color Background { get; set; }
Property Value
Type | Description |
---|---|
Color |
Decorators
Modifies the look of a cell with additional character.
Declaration
public List<CellDecorator>? Decorators { get; set; }
Property Value
Type | Description |
---|---|
List<CellDecorator> |
Foreground
The foreground color of this cell.
Declaration
public Color Foreground { get; set; }
Property Value
Type | Description |
---|---|
Color |
Glyph
The glyph index from a font for this cell.
Declaration
public int Glyph { get; set; }
Property Value
Type | Description |
---|---|
int |
GlyphCharacter
The glyph.
Declaration
[IgnoreDataMember]
public char GlyphCharacter { get; set; }
Property Value
Type | Description |
---|---|
char |
IsDirty
Declaration
public bool IsDirty { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsVisible
Declaration
public bool IsVisible { get; set; }
Property Value
Type | Description |
---|---|
bool |
Mirror
The mirror effect for this cell.
Declaration
public Mirror Mirror { get; set; }
Property Value
Type | Description |
---|---|
Mirror |
Methods
Clear()
Resets the foreground, background, glyph, mirror effect and decorators.
Declaration
public abstract void Clear()
Clone()
Returns a new cell with the same properties as this one.
Declaration
public abstract ColoredGlyphBase Clone()
Returns
Type | Description |
---|---|
ColoredGlyphBase | The new cell. |
CopyAppearanceFrom(ColoredGlyphBase, bool)
Sets the foreground, background, glyph, mirror effect and decorators to the same as the specified cell.
Declaration
public virtual void CopyAppearanceFrom(ColoredGlyphBase cell, bool deepCopy = true)
Parameters
Type | Name | Description |
---|---|---|
ColoredGlyphBase | cell | The target cell to copy from. |
bool | deepCopy | Whether to perform a deep copy. Decorators are copied to a new array when true; when false, the old decorator array reference is moved directly. |
CopyAppearanceTo(ColoredGlyphBase, bool)
Copies the visual appearance to the specified cell. This includes foreground, background, glyph, mirror effect and decorators.
Declaration
public virtual void CopyAppearanceTo(ColoredGlyphBase cell, bool deepCopy = true)
Parameters
Type | Name | Description |
---|---|---|
ColoredGlyphBase | cell | The target cell to copy to. |
bool | deepCopy | Whether to perform a deep copy. Decorators are copied to a new array when true; when false, the old decorator array reference is moved directly. |
CreateArray(int)
Creates an array of colored glyphs.
Declaration
public static ColoredGlyphBase[] CreateArray(int size)
Parameters
Type | Name | Description |
---|---|---|
int | size |
Returns
Type | Description |
---|---|
ColoredGlyphBase[] |
Matches(ColoredGlyphBase?)
Checks if this ColoredGlyph object's properties match another's.
Declaration
public bool Matches(ColoredGlyphBase? other)
Parameters
Type | Name | Description |
---|---|---|
ColoredGlyphBase | other | The other object to check. |
Returns
Events
IsDirtySet
Declaration
public event EventHandler? IsDirtySet
Event Type
Type | Description |
---|---|
EventHandler |