SadConsole.Cell.CopyAppearanceTo C# (CSharp) Method

CopyAppearanceTo() public method

Applies this appearance instance values to the destination appearance.
public CopyAppearanceTo ( ICellAppearance destination ) : void
destination ICellAppearance The target of the appearance copy.
return void
        public void CopyAppearanceTo(ICellAppearance destination)
        {
            destination.Foreground = this.Foreground;
            destination.Background = this.Background;
            destination.GlyphIndex = this.GlyphIndex;
            destination.SpriteEffect = this.SpriteEffect;
        }

Usage Example

示例#1
0
 /// <summary>
 /// Creates a new colored glyph based on the provided cell.
 /// </summary>
 /// <param name="cell">The cell.</param>
 public ColoredGlyph(Cell cell)
 {
     cell.CopyAppearanceTo(this);
     Glyph = (char)cell.GlyphIndex;
 }