Пример #1
0
        public static void Init(bool windowfixed)
        {
            if (!isInit)
            {
                screenWidth  = Console.WindowWidth;
                screenHeight = Console.WindowHeight;
                Console.SetBufferSize(screenWidth, screenHeight); // Remove SCroll bar

                WindowsAPI.SetWindowsPosition(topLeftXPos, topLeftYPos);
                Console.Title = ScreenTitle;

                isInit = true;
            }

            windowFixed = windowfixed;

            if (windowFixed)
            {
                WindowsAPI.DisableResize();
            }

            if (cursorOff)
            {
                Console.CursorVisible = !cursorOff;
            }
        }
Пример #2
0
        public static void Init(int screenwidth, int screenheight,
                                bool windowfixed = false, bool cursoroff = false,
                                int topLeftXpos  = 0, int topLeftYpos    = 0)
        {
            if (!isInit)
            {
                Console.SetWindowSize(screenwidth, screenheight);
                screenWidth  = Console.WindowWidth;
                screenHeight = Console.WindowHeight;
                Console.SetBufferSize(screenWidth, screenHeight); // Remove SCroll bar

                topLeftXPos = topLeftXpos;
                topLeftYPos = topLeftYpos;

                WindowsAPI.SetWindowsPosition(topLeftXPos, topLeftYPos);
                Console.Title = ScreenTitle;

                isInit = true;
            }

            windowFixed = windowfixed;
            cursorOff   = cursoroff;

            if (windowFixed)
            {
                WindowsAPI.DisableResize();
            }

            if (cursorOff)
            {
                Console.CursorVisible = !cursorOff;
            }
        }