Ejemplo n.º 1
0
        public static void RandomKeyColors(int repeat = 100, int millDelay = 5)
        {
            KeyControl.ResetBG();
            while (repeat > 0)
            {
                KeyControl.SetKey(rnd.Next(0, 21), rnd.Next(0, 6), new Color(rnd.Next(0, 255), rnd.Next(0, 255), rnd.Next(0, 255)));
                Thread.Sleep(millDelay);

                repeat--;
            }
        }
Ejemplo n.º 2
0
        public static void ShowText(string S)
        {
            Color col = null, prevCol = null;
            char  PrevC = 'c';
            bool  Clear = true;

            foreach (char C in S.ToUpper())
            {
                if (Clear)
                {
                    KeyControl.ResetBG(); Thread.Sleep(100); Clear = false;
                }

                while (col == prevCol)
                {
                    col = CPalette[rnd.Next(0, CPalette.Length)];
                }

                if (PrevC != 'c')
                {
                    KeyControl.SetKey(PrevC.ToString(), prevCol);
                }

                if (C == ' ' || C == '\n')
                {
                    Clear   = true;
                    prevCol = null;
                    PrevC   = 'c';
                }
                else
                {
                    KeyControl.SetKey(C.ToString(), Color.White);
                    prevCol = col;
                    PrevC   = C;
                }

                Thread.Sleep(800);
            }

            KeyControl.ResetBG();
        }