示例#1
0
        public override void DrawStep()
        {
            if (visible)
            {
                GraphicConsole.Instance.SetColors(Color4.Transparent, fillColor);
                DrawingUtilities.DrawRect(position.X, position.Y, size.X, size.Y, ' ', true);

                GraphicConsole.Instance.SetColors(borderColor, fillColor);
                DrawingUtilities.DrawRect(position.X, position.Y, size.X, size.Y, borderToken, false);

                if (isMultilined)
                {
                    for (int i = 0; i < lines.Length; i++)
                    {
                        GraphicConsole.Instance.SetColors(textColor, fillColor);
                        GraphicConsole.Instance.SetCursor((GraphicConsole.Instance.BufferWidth / 2) - (size.X - 4) / 2, position.Y + 2 + i);
                        GraphicConsole.Instance.Write(lines[i]);
                    }
                }
                else
                {
                    GraphicConsole.Instance.SetColors(textColor, fillColor);
                    GraphicConsole.Instance.SetCursor((GraphicConsole.Instance.BufferWidth / 2) - (size.X - 4) / 2, GraphicConsole.Instance.BufferHeight / 2);
                    GraphicConsole.Instance.Write(message);
                }
            }

            base.DrawStep();
        }
示例#2
0
        public override void DrawStep()
        {
            GraphicConsole.Instance.SetColors(textColor, fillColor);
            DrawingUtilities.DrawRect(Position.X, Position.Y, Size.X, Size.Y, ' ', true);

            if (!string.IsNullOrEmpty(text))
            {
                if (scroll)
                {
                    //Scroll Bar Rail
                    GraphicConsole.Instance.SetColors(scrollRailColor, fillColor);
                    for (int h = Position.Y; h < Size.Y + Position.Y; h++)
                    {
                        GraphicConsole.Instance.SetCursor(Position.X + Size.X, h);
                        GraphicConsole.Instance.Write(scrollRail);
                    }

                    //Scroll Bar
                    GraphicConsole.Instance.SetColors(scrollBarColor, fillColor);
                    GraphicConsole.Instance.SetCursor(Position.X + Size.X, (int)(scrollValue / 100f * Size.Y) + Position.Y);
                    GraphicConsole.Instance.Write(scrollBar);

                    string[] lines = text.Split('\n');
                    lineCount = lines.Length;

                    int line = (int)(scrollValue / 100f * (lines.Length - Size.Y + 1));
                    if (line < 0)
                    {
                        line = 0;
                    }

                    GraphicConsole.Instance.SetColors(textColor, fillColor);
                    for (int y = 0; y < Size.Y && y < lines.Length; y++)
                    {
                        if (line < lines.Length)
                        {
                            writeLine(lines[line], Position.X, Position.Y + y);
                        }

                        line++;
                    }
                }
                else
                {
                    string[] lines = text.Split('\n');
                    for (int line = 0; line < lines.Length && line < Size.Y; line++)
                    {
                        writeLine(lines[line], Position.X, Position.Y + line);
                    }
                }

                base.DrawStep();
            }
        }
示例#3
0
        public override void DrawStep()
        {
            clearArea();

            GraphicConsole.Instance.SetColors(Color4.Transparent, fillColor);
            DrawingUtilities.DrawRect(Position.X, Position.Y, Size.X, Size.Y, ' ', true);

            if (text != string.Empty)
            {
                GraphicConsole.Instance.SetColors(textColor, fillColor);
                GraphicConsole.Instance.SetCursor(Position);
                GraphicConsole.Instance.Write(text);
            }

            base.DrawStep();
        }
示例#4
0
        public override void DrawStep()
        {
            GraphicConsole.Instance.SetColors(Color4.Transparent, fillColor);
            DrawingUtilities.DrawRect(Position.X, Position.Y, Size.X, Size.Y, ' ', true);

            if (!scroll)
            {
                for (int i = 0; i < objectList.Count; i++)
                {
                    setConsoleColors(i);
                    GraphicConsole.Instance.SetCursor(Position.X, Position.Y + i);

                    writeLine(objectList[i].ListText);
                }
            }
            else
            {
                //Scroll Bar Rail
                GraphicConsole.Instance.SetColors(scrollRailColor, fillColor);
                DrawingUtilities.DrawLine(Position.X + Size.X, Position.Y, Position.X + Size.X, Position.Y + Size.Y - 1, scrollRail);

                //Scroll Barl
                GraphicConsole.Instance.SetColors(scrollBarColor, fillColor);
                GraphicConsole.Instance.SetCursor(Position.X + Size.X, (int)(scrollValue / 100f * Size.Y) + Position.Y);
                GraphicConsole.Instance.Write(scrollBar);

                int line = (int)(scrollValue / 100f * (objectList.Count - Size.Y + 1));
                if (line < 0)
                {
                    line = 0;
                }

                for (int y = 0; y < Size.Y; y++)
                {
                    if (line < objectList.Count)
                    {
                        setConsoleColors(line);
                        GraphicConsole.Instance.SetCursor(Position.X, Position.Y + y);
                        writeLine(objectList[line].ListText);
                    }
                    line++;
                }
            }

            base.DrawStep();
        }
示例#5
0
        public override void DrawStep()
        {
            clearArea();

            if (mode == ButtonModes.Hover)
            {
                //Fill Area
                GraphicConsole.Instance.SetColors(Color4.Transparent, fillColorHover);
                DrawingUtilities.DrawRect(Position.X, Position.Y, Size.X, Size.Y, ' ', true);

                //Write Text
                GraphicConsole.Instance.SetColors(textColorHover, fillColorHover);
                GraphicConsole.Instance.SetCursor(textPosition);
                GraphicConsole.Instance.Write(text);
            }
            else if (!enabled)
            {
                //Fill Area
                GraphicConsole.Instance.SetColors(Color4.Transparent, fillColor);
                DrawingUtilities.DrawRect(Position.X, Position.Y, Size.X, Size.Y, ' ', true);

                //Write Text
                GraphicConsole.Instance.SetColors(textColor, fillColor);
                GraphicConsole.Instance.SetCursor(textPosition);
                GraphicConsole.Instance.Write(text);
            }
            else if (enabled)
            {
                //Fill Area
                GraphicConsole.Instance.SetColors(Color4.Transparent, fillColorPressed);
                DrawingUtilities.DrawRect(Position.X, Position.Y, Size.X, Size.Y, ' ', true);

                //Write Text
                GraphicConsole.Instance.SetColors(textColorPressed, fillColorPressed);
                GraphicConsole.Instance.SetCursor(textPosition);
                GraphicConsole.Instance.Write(text);
            }

            base.DrawStep();
        }
示例#6
0
 protected virtual void clearArea()
 {
     GraphicConsole.Instance.ClearColor();
     DrawingUtilities.DrawRect(Position.X, Position.Y, Size.X, Size.Y, ' ', true);
 }