예제 #1
0
        private void Events_TickEvent(object sender, TickEventArgs e)
        {
            try
            {
                font.Style = (Styles)styleArray[rand.Next(styleArray.Length)];
                text = font.Render(
                    textArray[rand.Next(textArray.Length)],
                    Color.FromArgb(0, (byte)rand.Next(255),
                    (byte)rand.Next(255), (byte)rand.Next(255)));

                switch (rand.Next(4))
                {
                    case 1:
                        text = text.CreateFlippedVerticalSurface();
                        break;
                    case 2:
                        text = text.CreateFlippedHorizontalSurface();
                        break;
                    case 3:
                        text = text.CreateRotatedSurface(rand.Next(360));
                        break;
                    default:
                        break;
                }

                screen.Blit(
                    text,
                    new Rectangle(new Point(rand.Next(width - 100), rand.Next(height - 100)),
                    text.Size));
                screen.Update();
                Thread.Sleep(500);
            }
            catch
            {
                //sdl.Dispose();
                throw;
            }
        }