예제 #1
0
        /// <summary>
        /// Creation of the View object
        /// </summary>
        public override void onCreate(ScreenInfo screenInfo)
        {
            base.onCreate(screenInfo);

            // Show the header
            foreach (string line in Presenter.GetHeader())
            {
                int xPos = (Width / 2) - (line.Length / 2);
                Console.SetCursorPosition(xPos, Console.CursorTop);
                Console.WriteLine(line);
            }

            // Show the body content
            int maxLineSize = (Char.SELECT_CURSOR + 5 + Screen.HIGHSCORES.ToString()).Length;

            yPosSelection = BASE_POSY_CURSOR;
            xPosSelection = (Width / 2) - (maxLineSize / 2);

            screenName           = new Screen[] { Screen.PLAY, Screen.OPTIONS, Screen.HIGHSCORES, Screen.ABOUT };
            maxMenuLength        = screenName.Length;
            currentMenuCursorPos = 0;

            foreach (Screen name in screenName)
            {
                Console.SetCursorPosition(xPosSelection, yPosSelection);
                Console.WriteLine(name.ToString());
                yPosSelection += 2;
            }


            // Show the footer
            // Todo : display a footer ? (credits) ?
        }
예제 #2
0
        public override void onCreate(ScreenInfo screenInfo)
        {
            base.onCreate(screenInfo);

            // Display text
            int CursorPosY = 20;

            Console.SetCursorPosition(Console.CursorLeft, CursorPosY);

            string[] informationText = new string[]
            {
                "SPICY INVADER",
                "By Henoc Sese",
                "\n",
                "Music - Henoc Sese",
                "\n",
                "Programmer - Henoc Sese",
                "\n",
                "(c) Capsulo Inc."
            };

            foreach (string sentance in informationText)
            {
                int CursorPosX = (Console.WindowWidth / 2) - (sentance.Length / 2);
                Console.SetCursorPosition(CursorPosX, CursorPosY++);
                Console.WriteLine(sentance);
            }
        }
예제 #3
0
        /// <summary>
        /// Creation of the View object
        /// </summary>
        public override void onCreate(ScreenInfo screenInfo)
        {
            base.onCreate(screenInfo);

            // Set variables and options
            strMenuLines = new string[] {
                "Sound",
                "Level"
            };

            // Display text

            // Set the position of the menu cursor
            setCursorMenuPos(0);
        }
예제 #4
0
        /// <summary>
        /// Creation of the View object
        /// </summary>
        public virtual void onCreate(ScreenInfo screenInfo)
        {
            State = LifecycleState.CREATE;

            Debug.WriteLine("Creating the view : " + screenInfo.Name);

            if (screenInfo != null)
            {
                this.ScreenInfo = screenInfo;
            }
            else
            {
                throw new Exception();
            }
        }