Example #1
0
        static void Main(string[] args)
        {
            CompactGraphics graphics = new CompactGraphics(120, 50);
            Menu            main     = new IntroMenu(graphics);
            Input           inp      = new Input(false);

            while (true)
            {
                main.StepFrame();
                graphics.pushFrame();
            }
        }
Example #2
0
        public IntroMenu(CompactGraphics g) : base(g)
        {
            int centralX = 50.PercentX();

            mainTextbox = new CustomTextBox(new Rect(5.PercentX(), 95.PercentX(), 95.PercentY() - 7, 95.PercentY()));
            Image       = new PixelGrid(new Rect(centralX, centralX + 32, 50.PercentY() - 8, 50.PercentY() + 8));
            Image.PinTo(Widget.DrawPoint.Top);

            onPage.Add(mainTextbox);
            onPage.Add(Image);

            mainTextbox.updateText(TheCureGame.TextLines.IntroLines[0]);
        }
Example #3
0
 public override void Draw(CompactGraphics g)
 {
     for (int i = Bounds.x1; i <= Bounds.x2; i++)
     {
         for (int j = Bounds.y1; j <= Bounds.y2; j++)
         {
             if ((i == Bounds.x1 || i == Bounds.x2) && (j == Bounds.y1 || j == Bounds.y2))
             {
                 g.Draw(styleChart[Style][1], forColor, i, j);
             }
             else if (i == Bounds.x1 || i == Bounds.x2 || j == Bounds.y1 || j == Bounds.y2)
             {
                 g.Draw(borderchar, forColor, i, j);
             }
             g.DrawBackground(backcolor, i, j);
         }
     }
 }
Example #4
0
        public MainMenu(CompactGraphics g) : base(g)
        {
            specialRect mainrect = (new specialRect()
            {
                x = 50.PercentX(), y = 75.PercentY(), height = 6, width = 80.PercentX()
            }).Center();

            mainTextBox = new CustomTextBox(mainrect.RectFromSpecial());
            onPage.Add(mainTextBox);
            onPage.Add(new Textbox($"x:{mainTextBox.Bounds.x1}, y:{mainTextBox.Bounds.y1}, width: {mainTextBox.Bounds.width}, height: {mainTextBox.Bounds.height}", new Rect(10, 80, 15, 20)));
            fixedUpdateSet        = false;
            fixedUpdate           = new Timer(35);
            fixedUpdate.Elapsed  += Fixed_Update_Cycle;
            fixedUpdate.AutoReset = true;
            //System.Threading.Thread.Sleep(2000);
            inputString        = "The FitnessGram Pacer test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter Pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly, but gets faster each minute after you hear this signal *boop*. A single lap should be completed each time you hear this sound *ding*. Remember to run in a straight line, and run as long as possible. The second time you fail to complete a lap before the sound, your test is over. The test will begin on the word start. On your mark, get ready, start. ";
            FixedUpdateEnabled = true;
        }
Example #5
0
        static void Main(string[] args)
        {
            int[]           rgb = new int[] { 255, 0, 0 };
            CompactGraphics graphics;

            if (args.Length == 2)
            {
                graphics = new CompactGraphics(int.Parse(args[0]), int.Parse(args[1]));
            }
            else
            {
                graphics = new CompactGraphics(500, 200);
            }
            //CompactGraphics.Graphics.SetColor(ConsoleColor.White, 244, 106, 7);
            ExampleMenu    menu         = new ExampleMenu(graphics);
            ExtendedColors customPallet = new ExtendedColors();
            Input          I            = new Input();

            customPallet.SetColor("Sea Green", Color.FromArgb(46, 139, 87), ConsoleColor.Green);
            //graphics.FrameCap = 120;
            //Contunually draw frames
            while (true)
            {
                rgb = stepRainbow(rgb);
                //graphics.AddToPallet(Color.FromArgb(rgb[0], rgb[1], rgb[2]));
                ExtendedColors.SetColor(ConsoleColor.White, Color.FromArgb(rgb[0], rgb[1], rgb[2]));
                //update the UI
                menu.StepFrame(I);
                graphics.Draw($"{graphics.Fps} fps", ConsoleColor.White, 0, 0);
                graphics.Draw($"{graphics.TimeToDraw} drawTime", customPallet.GetColor("Sea Green"), 0, 1);
                graphics.Draw($"{graphics.TimeToFrame} ttf", ConsoleColor.White, 0, 2);
                //graphics.Draw($"{rgb[0]}, {rgb[1]}, {rgb[2]}", ConsoleColor.Red, 0, 6);
                //now that all drawing is done, push the frame to the buffer.
                graphics.pushFrame();
                //Console.WriteLine("\u001b[31mHello World!\u001b[0m");
            }
        }
Example #6
0
 public override void Draw(CompactGraphics g)
 {
     frame.Draw(g);
     text.Draw(g);
 }
 public virtual void Draw(CompactGraphics g, Input.inpuT input)
 {
     Draw(g);
 }
 public virtual void Draw(CompactGraphics g, Input input)
 {
     Draw(g);
     //throw new System.NotImplementedException();
 }
 /// <summary>
 /// Draws the widget to the current frame, after evaluating updating input.
 /// </summary>
 /// <param name="g">The Graphics to draw to</param>
 /// <param name="keyInfo">The User input to be handled.</param>
 public virtual void Draw(CompactGraphics g, System.ConsoleKeyInfo keyInfo)
 {
     throw new System.NotImplementedException();
 }
 /// <summary>
 /// Draws the widget to the current frame of the Graphics object
 /// </summary>
 /// <param name="g">The Graphics to draw to</param>
 public virtual void Draw(CompactGraphics g)
 {
     g.Draw(rendered, Bounds.x1, Bounds.y1);
     rendered = new TFrame(Bounds.x2 - Bounds.x1, Bounds.y2 - Bounds.y1);
 }