示例#1
0
        static void Main(string[] args)
        {
            //Image img = Image.FromFile("test.file");

            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.White;

            Console.Clear();

            GMU gmu = new GMU(100, 40, 0, 0);

            MultiSplitScreenManager msc = new MultiSplitScreenManager(gmu.PlacePixels, 40, 100);


            FullScreenManager full = new FullScreenManager(40, 100, null);

            msc.AddScreen(full, new Rectangle(0, 0, 40, 100));

            FullScreenManager fs1 = new FullScreenManager(50, 40, null);
            FullScreenManager fs2 = new FullScreenManager(50, 40, null);



            full.App_DrawScreen(BasicProvider.getInked(4, 100, new PInfo().SetBg(ConsoleColor.Black).SetFg(ConsoleColor.White)), 0, 0, null);

            gmu.PrintFrame();

            full.App_DrawScreen(BasicProvider.TextToPInfo("Test", 20, 20, new PInfo().SetFg(ConsoleColor.White)), 3, 3, null);

            gmu.PrintFrame();

            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine(Console.WindowWidth);
            Console.WriteLine(Console.WindowHeight);

            Console.WriteLine(Console.LargestWindowWidth);
            Console.WriteLine(Console.LargestWindowHeight);

            msc.AddScreen(fs1, new Rectangle(0, 0, 50, 40));
            msc.AddScreen(fs2, new Rectangle(50, 0, 50, 40));

            Console.ReadKey();
            gmu.PlacePixels(simpleSquare, 20, 8, null);

            fs1.App_DrawScreen(BasicProvider.getInked(48, 38, new PInfo(' ', ConsoleColor.White, ConsoleColor.Red)), 1, 1, null);
            fs2.App_DrawScreen(BasicProvider.getInked(48, 38, new PInfo(' ', ConsoleColor.White, ConsoleColor.Blue)), 1, 1, null);

            fs1.App_DrawScreen(simpleSquare, 1, 1, null);

            fs2.App_DrawScreen(BasicProvider.TextToPInfo("I try this new thing with text", 10, 10, new PInfo().SetFg(ConsoleColor.Black)), 3, 5, null);
            fs2.App_DrawScreen(BasicProvider.TextToPInfo("I try this new thing with text", 10, 10, new PInfo().SetFg(ConsoleColor.Red)), 3, 2, null);


            gmu.PrintFrame();

            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            Console.InputEncoding  = Encoding.Unicode;
            Console.OutputEncoding = Encoding.Unicode;

            GMU gmu = new GMU(120, 40, 0, 0);

            gmu.PlacePixels(BasicProvider.getInked(120, 60, new PInfo().SetBg(ConsoleColor.Black)), 0, 0, null);
            gmu.PrintFrame();

            MultiSplitScreenManager Screen = new MultiSplitScreenManager(gmu.PlacePixels, 120, 60);



            WindowScreenManager p1Thing    = new WindowScreenManager(1, 4, Screen.App_DrawScreen, new PInfo().SetBg(ConsoleColor.Gray).SetC('\u2656').SetFg(ConsoleColor.Blue));
            WindowScreenManager p2Thing    = new WindowScreenManager(1, 4, Screen.App_DrawScreen, new PInfo().SetBg(ConsoleColor.Gray).SetC('\u2656').SetFg(ConsoleColor.Blue));
            WindowScreenManager background = new WindowScreenManager(120, 40, Screen.App_DrawScreen, new PInfo().SetBg(ConsoleColor.Black));

            WindowScreenManager bThing = new WindowScreenManager(1, 1, Screen.App_DrawScreen, new PInfo().SetBg(ConsoleColor.White));



            Screen.AddScreen(p1Thing, new Rectangle(1, 18, 1, 4), 1);
            Screen.AddScreen(p2Thing, new Rectangle(118, 18, 1, 4), 1);
            Screen.AddScreen(background, new Rectangle(0, 0, 120, 40), 0);

            bool running = true;


            Point Ball = new Point(40, 20);


            Thread thread = new Thread(() => {
                while (running)
                {
                    System.Threading.Thread.Sleep(10);

                    int p1Move = 0;
                    int p2Move = 0;
                    #region input handeling
                    if (Keyboard.IsKeyDown(Key.W))
                    {
                        p1Move += -1;
                    }
                    if (Keyboard.IsKeyDown(Key.S))
                    {
                        p1Move += 1;
                    }
                    if (Keyboard.IsKeyDown(Key.Up))
                    {
                        p2Move += -1;
                    }
                    if (Keyboard.IsKeyDown(Key.Down))
                    {
                        p2Move += 1;
                    }
                    if (Keyboard.IsKeyDown(Key.Escape))
                    {
                        running = false;
                    }
                    if (Keyboard.IsKeyDown(Key.Space))
                    {
                    }
                    #endregion

                    #region movement

                    #endregion
                    #region score

                    #endregion
                    #region Time

                    #endregion

                    Screen.Render();
                    gmu.PrintFrame();
                }
            });

            thread.SetApartmentState(ApartmentState.STA); //Set the thread to STA
            thread.Start();
            thread.Join();



            Screen.Render();
            gmu.PrintFrame();

            Console.ReadKey();
        }