Exemplo n.º 1
0
        private static void RenderAutoComplete()
        {
            if (_suggestions.Count > 0)
            {
                var longestSuggestion = (from command in _suggestions
                                         orderby command.Length descending
                                         select command).First();

                var size = FontManager.MeasureString(longestSuggestion);

                var x = _inputBoxRight;
                var y = _inputBoxBottom - 2;

                var lines = Math.Min(_suggestions.Count, 20);
                var h     = (lines * 16) + 4 + 6;
                var w     = size + 4 + 6;

                Renderer2D.FillRectangle(new Color(0x44, 0x44, 0x44), x, y, w, h);
                Renderer2D.DrawRectangle(new Color(0x22, 0x22, 0x22), x, y, w, h);

                foreach (var line in _suggestions)
                {
                    FontManager.SetColor(Color.White);
                    FontManager.PrintString(new Vector2(x + 5, y + 5), line);

                    y += 16;
                }
            }
        }
Exemplo n.º 2
0
        private static void RenderInputBox()
        {
            var text  = "GBH2>^7 " + _inputBuffer;
            var tSize = FontManager.MeasureString(text);

            int x = 15;
            int y = 15;

            int w = _screenX - 30;
            int h = 16 + 3 + 3;

            Renderer2D.FillRectangle(new Color(0x44, 0x44, 0x44), x, y, w + 2, h + 2);
            Renderer2D.DrawRectangle(new Color(0x22, 0x22, 0x22), x, y, w + 2, h + 2);

            FontManager.SetColor(Color.Yellow);
            FontManager.PrintString(new Vector2(x + 7, y + 3), text);

            _inputBoxRight  = x + 7 + tSize;
            _inputBoxBottom = y + h + 2;
        }