Esempio n. 1
0
 public RenderContext(IViewport viewport, VirtualConsole console)
 {
     _console = console;
     Viewport = viewport;
 }
Esempio n. 2
0
        internal static void DrawChars(char value, int count, TvPoint location, CharacterAttribute attribute, IViewport boxModel, VirtualConsole console)
        {
            var chars  = new ConsoleCharacter[count];
            var zindex = boxModel.ZIndex;
            var cc     = new ConsoleCharacter()
            {
                Character = value, Attributes = attribute, ZIndex = zindex
            };
            var pos = ViewPointToConsolePoint(location, boxModel.Position);

            console.CopyCharacter(pos, cc, count);
        }
Esempio n. 3
0
        public static void Clear(IViewport boxModel, VirtualConsole console)
        {
            var location = ViewPointToConsolePoint(new TvPoint(0, 0), boxModel.Position);

            console.DrawAt(new string(' ', boxModel.Columns), location, int.MinValue, new CharacterAttribute());
        }
Esempio n. 4
0
        public static void DrawStringAt(string text, TvPoint location, CharacterAttribute attr, IViewport boxModel, VirtualConsole console)
        {
            var consoleLocation = ViewPointToConsolePoint(location, boxModel.Position);
            var zindex          = boxModel.ZIndex;

            if (boxModel.Columns < text.Length)
            {
                text = text.Substring(0, boxModel.Columns);
            }
            console.DrawAt(text, consoleLocation, zindex, attr);
        }