Exemple #1
0
 public override void Draw(Sprite sprite)
 {
     foreach (var pixel in sprite)
     {
         pixel.Draw(this);
     }
     ConsoleScreen.Draw(sprite.X + sprite.Width, sprite.Y, sprite.Color, () => Console.Write(sprite));
 }
Exemple #2
0
        public void Draw(Pixel pixel)
        {
            var y = pixel.Y;

            foreach (var line in sprite)
            {
                ConsoleScreen.Draw(pixel.X, y--, pixel.Color, () => Console.Write(line));
            }
        }
Exemple #3
0
        public void Draw(CharPixel pixel)
        {
            var x = ConsoleScreen.ToScreenX(pixel.X);
            var y = ConsoleScreen.ToScreenY(pixel.Y);

            if (x < 0 || x >= width || y < 0 || y >= height)
            {
                return;
            }
            var i = width * y + x;

            canvas[i] = pixel.Value;
            colors[i] = pixel.Color;
        }
Exemple #4
0
 public void Draw(Pixel pixel)
 {
     ConsoleScreen.Draw(pixel.X, pixel.Y, pixel.Color, () => Console.Write(representation));
 }