Esempio n. 1
0
        /// <summary>
        /// Converts this REXPaint image to a <see cref="LayeredConsole"/>.
        /// </summary>
        /// <returns></returns>
        public LayeredConsole ToLayeredConsole()
        {
            var console = new LayeredConsole(Width, Height, LayerCount);

            for (int i = 0; i < LayerCount; i++)
            {
                CellSurfaceLayer layer = console.GetLayer(i);

                for (int y = 0; y < Height; y++)
                {
                    for (int x = 0; x < Width; x++)
                    {
                        Cell rexCell = _layers[i][x, y];
                        if (rexCell.IsTransparent())
                        {
                            continue;
                        }

                        SadConsole.Cell newCell = layer[x, y];
                        newCell.Foreground = new FrameworkColor(rexCell.Foreground.R, rexCell.Foreground.G, rexCell.Foreground.B, (byte)255);
                        newCell.Background = new FrameworkColor(rexCell.Background.R, rexCell.Background.G, rexCell.Background.B, (byte)255);
                        newCell.Glyph      = rexCell.Character;
                    }
                }

                layer.IsDirty = true;
            }

            console.IsDirty = true;
            return(console);
        }
Esempio n. 2
0
 public static void ClearEffect(this SadConsole.Cell cell)
 {
     if (cell.Effect != null)
     {
         cell.Effect.Clear(cell);
     }
     cell.Effect = null;
 }
Esempio n. 3
0
        public TextBoxTheme()
        {
            CaretEffect = new Effects.BlinkGlyph()
            {
                GlyphIndex = 95,
                BlinkSpeed = 0.4f
            };

            Normal = new SadConsole.Cell(Colors.Text, Colors.GrayDark);
        }
Esempio n. 4
0
        /// <inheritdoc />
        public override void RefreshTheme(Colors themeColors)
        {
            base.RefreshTheme(themeColors);

            Normal = new SadConsole.Cell(themeColors.Text, themeColors.GrayDark);
        }
Esempio n. 5
0
 public static void ApplyEffect(this SadConsole.Cell cell, ICellEffect effect)
 {
     cell.ClearEffect();
     cell.Effect = effect;
     cell.Effect.Apply(cell);
 }