Beispiel #1
0
        public ConsoleDrawer(int x, int y, int width, int height, Vector2Int scale)
        {
            posX             = x;
            posY             = y;
            Scale            = scale;
            _backgroundLayer = new ConsoleColorLayer(width, height);
            _textLayer       = new ConsoleTextLayer(width, height);

            Width  = width;
            Height = height;
        }
Beispiel #2
0
        static void InitConsoleDrawer(ConsoleMap map, Vector2Int scale, int spacing, Vector2Int start, Vector2Int stop, int index)
        {
            ConsoleColorLayer backgroundLayer = map.GetColorLayer();
            ConsoleTextLayer  textLayer       = new ConsoleTextLayer(backgroundLayer.Width, backgroundLayer.Height);

            int x      = (map.Width * scale.X + spacing) * index;
            var drawer = new ConsoleDrawer(x, 0, scale, backgroundLayer, textLayer);

            drawer.SetTextCell(start.X, start.Y, "S");
            drawer.SetTextCell(stop.X, stop.Y, "E");

            Console.CursorTop = map.Height;
            drawer.Draw();

            _consoleDrawers[index] = drawer;
        }
Beispiel #3
0
        public ConsoleDrawer(int x, int y, Vector2Int scale, ConsoleColorLayer backgroundLayer, ConsoleTextLayer textLayer)
        {
            if (backgroundLayer.Width != textLayer.Width || backgroundLayer.Height != textLayer.Height)
            {
                throw new ArgumentException("Layer dimensions must match");
            }

            _backgroundLayer = backgroundLayer;
            _textLayer       = textLayer;

            posX  = x;
            posY  = y;
            Scale = scale;

            Width  = backgroundLayer.Width;
            Height = backgroundLayer.Height;
        }