Esempio n. 1
0
        public void Render(ref String[] Document, Boolean Partial)
        {
            //Draw the stored graphic
            if (!Partial)
            {
                int X = 1;
                foreach (String Line in Document)
                {
                    RenderUtils.SetPos(0, X);
                    HiColorGraphic.HiColorDraw(Line);
                    X++;
                }
            }


            //Draw the color wheel
            RenderUtils.SetPos(Console.WindowWidth - ColorWheel.Split('-').Length - 4, Console.WindowHeight - 2);
            HiColorGraphic.HiColorDraw(ColorString + "-000-" + ColorWheel);
            ConsoleColor PickerColor;

            if (CustomColor)
            {
                PickerColor = ConsoleColor.Red;
            }
            else
            {
                PickerColor = ConsoleColor.DarkRed;
            }

            Draw.Row(ConsoleColor.Black, ColorWheel.Split('-').Length, Console.WindowWidth - ColorWheel.Split('-').Length - 2, Console.WindowHeight - 1);
            Draw.Block(PickerColor, Console.WindowWidth - ColorWheel.Split('-').Length - 2 + CurrentColorWheelPosition, Console.WindowHeight - 1);

            Draw.Sprite("Use PGUP/PGDOWN to change colors, C to open the\nold color editor, K to pick color, and SPACE to draw.", ConsoleColor.Black, ConsoleColor.White, 0, Console.WindowHeight - 2);
        }
Esempio n. 2
0
        public void KeyPress(ref string[] Document, int X, int Y, ConsoleKeyInfo Key)
        {
            switch (Key.Key)
            {
            case ConsoleKey.PageUp:
                //Move up in the color wheel
                CurrentColorWheelPosition++;
                break;

            case ConsoleKey.PageDown:
                //Move down in the color wheel
                CurrentColorWheelPosition--;
                break;

            case ConsoleKey.K:
                //Pick Color
                ColorString = Document[Y].Split('-')[X];
                CustomColor = true;
                break;

            case ConsoleKey.C:
                HiColorPicker Picker = new HiColorPicker();
                Picker.Execute();
                if (Picker.OK())
                {
                    ColorString = Picker.GetResultColorString();
                    CustomColor = true;
                }
                Render(ref Document, false);
                break;

            case ConsoleKey.Spacebar:
                //Replace the text at that position
                string[] Line = Document[Y].Split('-');
                Line[X]     = ColorString;
                Document[Y] = String.Join("-", Line);
                HiColorGraphic.HiColorDraw(ColorString);
                break;

            default:
                return;
            }

            Render(ref Document, true);
        }
 public override void DrawPixel(string ColorString)
 {
     HiColorGraphic.HiColorDraw(ColorString);
 }