Пример #1
0
 public void Reset(ConsoleDisplay display)
 {
     output            = "";
     outputScrollPoint = 0;
     this.display      = display;
     inputs            = new Input[2] {
         new Input(), new Input()
     };
     activeInput   = inputs[0];
     maxInputLines = 8;
 }
Пример #2
0
        public void Resize(Rectangle ScreenPosition, int FontScale)
        {
            int width  = ScreenPosition.Width / (6 * FontScale);
            int height = ScreenPosition.Height / (8 * FontScale);

            var rowSize    = ScreenPosition.Height / height;
            var realHeight = height * rowSize;
            var colSize    = ScreenPosition.Width / width;
            var realWidth  = width * colSize;

            ActualDrawSize = new Rectangle(
                ScreenPosition.X + ((ScreenPosition.Width - realWidth) / 2),
                ScreenPosition.Y + ((ScreenPosition.Height - realHeight) / 2),
                realWidth,
                realHeight);

            Display      = new ConsoleDisplay(width, height, font, Graphics, Content);
            Buffer       = new DynamicConsoleBuffer(2048, Display);
            InputHandler = new ConsoleInputHandler(ConsoleCommandHandler, Buffer, width);

            this.ScreenPosition  = ScreenPosition;
            ConsoleRenderSurface = new RenderTarget2D(Graphics, width * font.glyphWidth, height * font.glyphHeight, false,
                                                      SurfaceFormat.Color, DepthFormat.Depth16);
        }
Пример #3
0
 public DynamicConsoleBuffer(int scrollbackSize, ConsoleDisplay display)
 {
     this.scrollbackSize = scrollbackSize;
     Reset(display);
 }
Пример #4
0
 public void Reset(ConsoleDisplay display)
 {
     output = "";
     outputScrollPoint = 0;
     this.display = display;
     inputs = new Input[2] { new Input(), new Input() };
     activeInput = inputs[0];
     maxInputLines = 8;
 }
Пример #5
0
        public void Resize(Rectangle ScreenPosition, int FontScale)
        {
            int width = ScreenPosition.Width / (6 * FontScale);
            int height = ScreenPosition.Height / (8 * FontScale);

            var rowSize = ScreenPosition.Height / height;
            var realHeight = height * rowSize;
            var colSize = ScreenPosition.Width / width;
            var realWidth = width * colSize;

            ActualDrawSize = new Rectangle(
                ScreenPosition.X + ((ScreenPosition.Width - realWidth) / 2),
                ScreenPosition.Y + ((ScreenPosition.Height - realHeight) / 2),
                realWidth,
                realHeight);

            Display = new ConsoleDisplay(width, height, font, Graphics, Content);
            Buffer = new DynamicConsoleBuffer(2048, Display);
            InputHandler = new ConsoleInputHandler(ConsoleCommandHandler, Buffer, width);

            this.ScreenPosition = ScreenPosition;
            ConsoleRenderSurface = new RenderTarget2D(Graphics, width * font.glyphWidth, height * font.glyphHeight, false,
                SurfaceFormat.Color, DepthFormat.Depth16);
        }
Пример #6
0
 public DynamicConsoleBuffer(int scrollbackSize, ConsoleDisplay display)
 {
     this.scrollbackSize = scrollbackSize;
     Reset(display);
 }