Example #1
0
        public override void Draw(GameTime gameTime)
        {
            const int ident = 5;
            int       DY    = 0;

            if (Death.Height < TQMG.ScrHeight)
            {
                DY = TQMG.ScrHeight - Death.Height;
            }
            TQMG.Color(0, 18, 25);
            TQMG.SetAlpha(255);
            TQMG.DrawRectangle(0, 0, TQMG.ScrWidth, TQMG.ScrHeight);
            TQMG.Color(0, 36, 50);
            Death.Draw(0, DY);
            TQMG.Color(255, 180, 100);
            SysFont.DrawText("OOPS!", ident, 0);
            TQMG.Color(255, 255, 0);
            SysFont.DrawText("You tried something we didn't think of!", 50, 25);
            TQMG.Color(0, 180, 255);
            SysFont.DrawText(sct, ident, 75);
            TQMG.Color(0, 200, 255);
            SysFont.DrawText(smsg, ident, 125);
            TQMG.Color(0, 220, 255);
            SysFont.DrawText(strace, ident, 250);
            TQMG.Color(0, 255, 255);
            SysFont.DrawText("Hit Escape to exit this application", 50, TQMG.ScrHeight - 30);
        }
Example #2
0
        public override void Update(GameTime gameTime)
        {
            // Please note, these routines do not scan anything. They only return the value the last TQMG.Start() request done in the main routine scanned for.
            var b = TQMGKey.GetChar();
            var k = TQMGKey.GetKey();

            switch (k)
            {
            case Keys.Back:
                if (TypingCommand != "")
                {
                    TypingCommand = qstr.Left(TypingCommand, TypingCommand.Length - 1);
                }
                break;

            case Keys.Enter: {
                WriteLine($">{TypingCommand}", 255, 180, 0);
                var c = TypingCommand;
                TypingCommand = "";
                Exe(c);
            }

            break;

            case Keys.Escape:
                if (returnto == null)
                {
                    CError("No flow to return to!");
                }
                else
                {
                    FlowManager.HFC = returnto;
                }
                break;

            default: {
                int tw = 0, th = 0;
                SysFont.TextSizes($"{TypingCommand}__", ref tw, ref th);
                if (b >= 32 && b <= 126 && tw < TQMG.ScrWidth - 25)
                {
                    TypingCommand += b;
                }
                break;
            }
            }
            // Scroll
            if (TQMGKey.Held(Keys.Down) && ScrollUp > 0)
            {
                ScrollUp -= 2;
            }
            if (TQMGKey.Held(Keys.Up) && ScrollUp < StartY)
            {
                ScrollUp += 2;
            }
        }
Example #3
0
 public override void Draw(GameTime gameTime)
 {
     TQMG.Color(255, 255, 255);
     if (BackGround != null)
     {
         TQMG.Tile(BackGround, 0, 0, 0, 0, TQMG.ScrWidth, TQMG.ScrHeight);
     }
     try {
         var y = ScrollUp - StartY;
         foreach (BCLine l in Line)
         {
             if (y > -30)
             {
                 //SysFont.DrawText(l.txt, 2, y);
                 l.Show(2, y);
             }
             y += 22;
         }
         TQMG.Color(255, 180, 0);
         SysFont.DrawText($">{TypingCommand}_", 2, y);
     } catch (Exception error) {
         Debug.WriteLine($"Exception during the debug log rendering!\n{error.Message}\nTraceback:\n{error.StackTrace}\n\n");
     }
 }
Example #4
0
 public void DrawText(string t, int x, int y) => SysFont.DrawText(t, x, y);
Example #5
0
 public void Show(int x, int y)
 {
     TQMG.Color(r, g, b);
     SysFont.DrawText(txt, x, y);
 }