コード例 #1
0
ファイル: Program.cs プロジェクト: payam49er/StdPaint
        static void Painter_Starting(object sender, EventArgs e)
        {
            paintBuffer       = ConsoleBuffer.CreateScreenBuffer();
            display           = new SevenSegmentDisplay(new Point(Console.BufferWidth - 1, 1), 6, 0);
            display.ForeBrush = new HorizontalStripeBufferBrush(1, BufferColor.Green, BufferColor.DarkGreen);
            display.BackBrush = SolidBufferBrush.Black;

            fpsThread = new Thread(FPSUpdateThread);
            fpsThread.Start();
        }
コード例 #2
0
        static void Painter_Starting(object sender, EventArgs e)
        {
            prevPos = new Point(-1, -1);
            int w      = Painter.ActiveBufferWidth;
            int h      = Painter.ActiveBufferHeight;
            var buffer = Painter.ActiveBufferData;

            tickBuffer = ConsoleBuffer.CreateScreenBuffer();
            Random rand = new Random();

            for (int i = 0; i < w; i++)
            {
                for (int j = 0; j < h; j++)
                {
                    if (rand.Next(0, 4) == 0)
                    {
                        buffer[j, i].Attributes = white;
                    }
                }
            }
        }