예제 #1
0
		public GameLevel ()
		{
            layerInstance = this;

			// enable touches
#if XBOX || OUYA
            TouchEnabled = false;
            GamePadEnabled = true;
#else
			TouchEnabled = true;
#endif

			// enable accelerometer
			AccelerometerEnabled = false;

			// ask director for the window size
			var screenSize = CCDirector.SharedDirector.WinSize;

			// create and initialize a Label
			var label = new CCLabelTTF("Game Layer", "MarkerFelt", 22);

			// position the label on the center of the screen
			label.Position = CCDirector.SharedDirector.WinSize.Center;

			// add the label as a child to this Layer
			AddChild(label);

			menuStartPosition = new CCPoint( 70 , screenSize.Height-24);

			var gameMenuLabel = new CCLabelTTF("Game Menu", "MarkerFelt", 18);
			var button1 = new CCMenuItemLabel (gameMenuLabel, ShowMenu);

			MenuButton = new CCMenu (button1);
			MenuButton.Position = menuStartPosition;

			AddChild (MenuButton, 10);

			openWithMenuInsteadOfGame = false;

            if (GameData.SharedData.FirstRunEver && openWithMenuInsteadOfGame)
            {
                CCLog.Log("First run ever");
                Schedule(ShowMenuFromSelector, 2f);
                GameData.SharedData.FirstRunEver = false;
            }

        }
예제 #2
0
        public GameLevel()
        {
            layerInstance = this;

            // enable touches
#if XBOX || OUYA
            TouchEnabled   = false;
            GamePadEnabled = true;
#else
            TouchEnabled = true;
#endif

            // enable accelerometer
            AccelerometerEnabled = false;

            // ask director for the window size
            var screenSize = CCDirector.SharedDirector.WinSize;

            // create and initialize a Label
            var label = new CCLabelTTF("Game Layer", "MarkerFelt", 22);

            // position the label on the center of the screen
            label.Position = CCDirector.SharedDirector.WinSize.Center;

            // add the label as a child to this Layer
            AddChild(label);

            menuStartPosition = new CCPoint(70, screenSize.Height - 24);

            var gameMenuLabel = new CCLabelTTF("Game Menu", "MarkerFelt", 18);
            var button1       = new CCMenuItemLabel(gameMenuLabel, ShowMenu);

            MenuButton          = new CCMenu(button1);
            MenuButton.Position = menuStartPosition;

            AddChild(MenuButton, 10);

            openWithMenuInsteadOfGame = false;

            if (GameData.SharedData.FirstRunEver && openWithMenuInsteadOfGame)
            {
                CCLog.Log("First run ever");
                Schedule(ShowMenuFromSelector, 2f);
                GameData.SharedData.FirstRunEver = false;
            }
        }
예제 #3
0
        public GameLevel()
        {
            layerInstance = this;

            // enable touches
#if XBOX || OUYA
            TouchEnabled = false;
            GamePadEnabled = true;
#else
            //TouchEnabled = true;
#endif

            // enable accelerometer
            //AccelerometerEnabled = false;

            // ask director for the window size
            var screenSize = Director.WindowSizeInPixels;

          

            menuStartPosition = new CCPoint(70, screenSize.Height - 24);

            var gameMenuLabel = new CCLabel("Game Menu", "MarkerFelt", 18);
            var button1 = new CCMenuItemLabel(gameMenuLabel, ShowMenu);

            MenuButton = new CCMenu(button1);
            MenuButton.Position = menuStartPosition;

            AddChild(MenuButton, 10);

            openWithMenuInsteadOfGame = false;

            if (GameData.SharedData.FirstRunEver && openWithMenuInsteadOfGame)
            {
                CCLog.Log("First run ever");
                Schedule(ShowMenuFromSelector, 2f);
                GameData.SharedData.FirstRunEver = false;
            }

        }
예제 #4
0
        public GameLevel()
        {
            layerInstance = this;

            // enable touches
#if XBOX || OUYA
            TouchEnabled   = false;
            GamePadEnabled = true;
#else
            //TouchEnabled = true;
#endif

            // enable accelerometer
            //AccelerometerEnabled = false;

            // ask director for the window size
            var screenSize = Director.WindowSizeInPixels;



            menuStartPosition = new CCPoint(70, screenSize.Height - 24);

            var gameMenuLabel = new CCLabel("Game Menu", "MarkerFelt", 18);
            var button1       = new CCMenuItemLabel(gameMenuLabel, ShowMenu);

            MenuButton          = new CCMenu(button1);
            MenuButton.Position = menuStartPosition;

            AddChild(MenuButton, 10);

            openWithMenuInsteadOfGame = false;

            if (GameData.SharedData.FirstRunEver && openWithMenuInsteadOfGame)
            {
                CCLog.Log("First run ever");
                Schedule(ShowMenuFromSelector, 2f);
                GameData.SharedData.FirstRunEver = false;
            }
        }