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)); }
public void Draw(Pixel pixel) { var y = pixel.Y; foreach (var line in sprite) { ConsoleScreen.Draw(pixel.X, y--, pixel.Color, () => Console.Write(line)); } }
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; }
public void Draw(Pixel pixel) { ConsoleScreen.Draw(pixel.X, pixel.Y, pixel.Color, () => Console.Write(representation)); }