コード例 #1
0
ファイル: UI.cs プロジェクト: podkolzzzin/WCMDManager
        public ConsoleElement(int x, int y, int w, int h, string text, ConsoleElementStyle style = ConsoleElementStyle.CENTER, ConsoleColor textColor = ConsoleColor.White, ConsoleColor bgColor = ConsoleColor.DarkGray)
        {
            this.x          = x;
            this.y          = y;
            this.w          = w;
            this.h          = h;
            this._bgColor   = bgColor;
            this._textColor = textColor;
            this.text       = text;
            if (style == ConsoleElementStyle.CENTER)
            {
                rez = new string(' ', (this.w - this.text.Length) / 2);
                rez = rez + text + rez;
            }
            else if (style == ConsoleElementStyle.RIGHT)
            {
                rez  = new string(' ', this.w - this.text.Length);
                rez += text;
            }
            else
            {
                rez = new string(' ', this.w - this.text.Length);
                rez = text + rez;
            }


            //this.deActive();
        }
コード例 #2
0
ファイル: UI.cs プロジェクト: podkolzzzin/WCMDManager
        public ConsoleElement(int x, int y, int w, int h, string text, ConsoleElementStyle style = ConsoleElementStyle.CENTER,ConsoleColor textColor=ConsoleColor.White,ConsoleColor bgColor=ConsoleColor.DarkGray)
        {
            this.x = x;
            this.y = y;
            this.w = w;
            this.h = h;
            this._bgColor = bgColor;
            this._textColor = textColor;
            this.text = text;
            if (style == ConsoleElementStyle.CENTER)
            {
                rez = new string(' ', (this.w - this.text.Length) / 2);
                rez = rez + text + rez;
            }
            else if (style == ConsoleElementStyle.RIGHT)
            {
                rez = new string(' ', this.w - this.text.Length);
                rez += text;
            }
            else
            {
                rez = new string(' ', this.w - this.text.Length);
                rez = text + rez;
            }

            //this.deActive();
        }