Exemple #1
0
        public NewGameMenu(int w, int h, ContentManager content)
            : base(0, 0, w, h)
        {
            instance = this;
            Texture2D buttonUp = content.Load<Texture2D>("menuImages/blankbuttonGlow");
            Texture2D buttonDown = content.Load<Texture2D>("menuImages/blankbuttonDarkGlow");

            Texture2D checkedImage = content.Load<Texture2D>("menuImages/checkbox2");
            Texture2D unCheckedImage = content.Load<Texture2D>("menuImages/checkbox");

            Point location;

            UI.ImageLabel backGroundImage, panel1,menuTitle;

            backGroundImage= (new UI.ImageLabel(0, 0, content.Load<Texture2D>("menuImages/barnSidewithGlow")));
            backGroundImage.resize(w, h);
            addComponent(backGroundImage);

            location = backGroundImage.getPos();
            columnLeft = (backGroundImage.getWidth() / 4);
            columnRight = location.X + (backGroundImage.getWidth() / 2+20);
            verticalSpacing = 100;
            fontScale = 0.5f;

            panel1 = (new UI.ImageLabel(columnLeft, backGroundImage.getPos().Y + 10,
                content.Load<Texture2D>("menuImages/tutorialtipbox")));
            panel1.resize((backGroundImage.getWidth() / 2), backGroundImage.getHeight() - 50);
            addComponent(panel1);
            //panel2 = (new UI.ImageLabel(columnRight, backGroundImage.getPos().Y + 10,
            //content.Load<Texture2D>("menuImages/menuPanelTrans85")));
            //panel2.resize((backGroundImage.getWidth()/2) - 100, backGroundImage.getHeight() - 50);
            //addComponent(panel2);

            menuTitle = (new UI.ImageLabel(columnLeft - 100, location.Y + (verticalSpacing / 10),
                content.Load<Texture2D>("menuImages/M_newGameMenuTitle")));
            menuTitle.scale(1);
            addComponent(menuTitle);

            UI.PushButton startButton = new UI.PushButton(((backGroundImage.getWidth() / 3) - (buttonUp.Width/3)),
                (backGroundImage.getHeight() - (buttonUp.Height * 2)), buttonUp, buttonDown, "");//return to start
            startButton.resize(185, 65);
            addComponent(startButton);
            startButton.setClickEventHandler(startButtonClicked);
            Point buttonlocation = startButton.getPos();
            ////load the start font onto the button
            UI.TextLabel startText = new UI.TextLabel(buttonlocation.X, buttonlocation.Y, startButton.getWidth(),
                                   startButton.getHeight(), "Return", 0.4f, Color.White);
            addComponent(startText);

            //button to load the tutorial
            UI.PushButton tutorialButton = new UI.PushButton((buttonlocation.X+startButton.getWidth()+20),
                (backGroundImage.getHeight() - (buttonUp.Height * 2)), buttonUp, buttonDown, "");//return to start
            tutorialButton.resize(185, 65);
            addComponent(tutorialButton);
            tutorialButton.setClickEventHandler(tutorialButtonClicked);
            buttonlocation = tutorialButton.getPos();
            ////load the start font onto the button
            UI.TextLabel tutorialText = new UI.TextLabel(buttonlocation.X, buttonlocation.Y, startButton.getWidth(),
                                   startButton.getHeight(), "Tutorial", 0.4f, Color.White);
            addComponent(tutorialText);

            UI.PushButton playButton = new UI.PushButton((buttonlocation.X + tutorialButton.getWidth() + 20),
                (backGroundImage.getHeight() - (buttonUp.Height * 2)), buttonUp, buttonDown, "");//return to start
            playButton.resize(185, 65);
            addComponent(playButton);
            playButton.setClickEventHandler(playButtonClicked);
             buttonlocation = playButton.getPos();
            ////load the start font onto the button
            UI.TextLabel playText = new UI.TextLabel(buttonlocation.X, buttonlocation.Y, startButton.getWidth(),
                                   startButton.getHeight(), "Continue", 0.4f, Color.White);
            addComponent(playText);
            //------------------------------------OptionsScreenOptions---------------------------------------------------------------
             ////group 1 Screen Options
             //  ArrayList optionGroup1 = new ArrayList();
             //  windowedChecked_NG = new UI.CheckBox(columnLeft + 20, location.Y + verticalSpacing, checkedImage,
             //  unCheckedImage, "Windowed", true);
             //  windowedChecked_NG.changeFontScale(fontScale);
             //  addComponent(windowedChecked_NG);
             //  fullScreenChecked_NG = new UI.CheckBox(columnLeft + 20, location.Y + (verticalSpacing * 2), checkedImage,
             //  unCheckedImage, "Full Screen", false);
             //  fullScreenChecked_NG.changeFontScale(fontScale);
             //  addComponent(fullScreenChecked_NG);

             //  optionGroup1.Add(windowedChecked_NG);
             //  optionGroup1.Add(fullScreenChecked_NG);
             //  windowedChecked_NG.buttonGroup = optionGroup1;
             //  fullScreenChecked_NG.buttonGroup = optionGroup1;

             //   //group 2 Audio Options
             //  ArrayList optionGroup2 = new ArrayList();
             //  musicChecked_NG = new UI.CheckBox(columnLeft + 20, location.Y + (verticalSpacing * 3), checkedImage,
             //  unCheckedImage, "Music ON/OFF", true);
             //  musicChecked_NG.changeFontScale(fontScale);
             //  addComponent(musicChecked_NG);
             //  soundEffectsChecked_NG = new UI.CheckBox(columnLeft + 20, location.Y + (verticalSpacing * 4), checkedImage,
             //  unCheckedImage, "SFX ON/OFF", true);
             //  soundEffectsChecked_NG.changeFontScale(fontScale);
             //  addComponent(soundEffectsChecked_NG);
            //------------------------------------EndOptionsScreenOptions----------------------------------------------------------
               //optionGroup2.Add(musicChecked);
               //optionGroup2.Add(soundEffectsChecked);
               //musicChecked.buttonGroup = optionGroup2;
               //soundEffectsChecked.buttonGroup = optionGroup2;

            //group 3 character Options
               ArrayList optionGroup3 = new ArrayList();
               maleChecked = new UI.CheckBox(columnLeft + 20, location.Y + (verticalSpacing * 2), checkedImage,
               unCheckedImage, "   Male Character", true);
               maleChecked.changeFontScale(fontScale);
               addComponent(maleChecked);
               femaleChecked = new UI.CheckBox(columnLeft + 20, location.Y + (verticalSpacing * 3), checkedImage,
               unCheckedImage, "  Female Character", false);
               femaleChecked.changeFontScale(fontScale);
               addComponent(femaleChecked);

               optionGroup3.Add(maleChecked);
               optionGroup3.Add(femaleChecked);
               maleChecked.buttonGroup = optionGroup3;
               femaleChecked.buttonGroup = optionGroup3;

            //group 4 Goal/Victory Options
               ArrayList optionGroup4 = new ArrayList();
               timedChecked = new UI.CheckBox(columnLeft + 20, location.Y + (verticalSpacing * 4), checkedImage,
               unCheckedImage, "Timed Game Victory", true);
               timedChecked.changeFontScale(fontScale);
               addComponent(timedChecked);
               monetaryChecked = new UI.CheckBox(columnLeft + 20, location.Y + (verticalSpacing * 5), checkedImage,
               unCheckedImage, " Bank Payoff Victory", false);
               monetaryChecked.changeFontScale(fontScale);
               addComponent(monetaryChecked);

               optionGroup4.Add(timedChecked);
               optionGroup4.Add(monetaryChecked);
               timedChecked.buttonGroup = optionGroup4;
               monetaryChecked.buttonGroup = optionGroup4;
        }
Exemple #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        /// 
        //test the scene Model
        //Model myScene;
        ////the aspect ratio determines how to scale 3d to 3d projection
        //float aspectRatio;
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // load your game content

            //myScene = Content.Load<Model>("Models\\chickenScene");
            //aspectRatio = graphics.GraphicsDevice.Viewport.AspectRatio;

            new AudioManager(Content);
            UI.Component.font = Content.Load<SpriteFont>("UIFont");
            UI.PushButton.disabledTexture = Content.Load<Texture2D>("MenuImages/darkMenuPaneltrans50");

            //load the menu screens
            startScreen = new GameUI.startMenuScreen(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content);
            gameInterfaceScreen = new GameUI.gameInterface(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content, graphics);
            helpScreen = new GameUI.helpScreen(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content);
            optionsScreen = new GameUI.optionsMenuScreen(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content);
            creditsScreen = new GameUI.creditsScreen(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content);
            newGameScreen = new GameUI.NewGameMenu(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content);
            splashScreen = new GameUI.splashScreen(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content);
            winlossScreen = new GameUI.VictoryLossScreen(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content);
            tutorialScreen = new GameUI.tutorialScreen(graphics.GraphicsDevice.Viewport.Width,
               graphics.GraphicsDevice.Viewport.Height, Content, graphics);

            mouseCursor = new UI.MouseCursor(0, 0, Content.Load<Texture2D>("MenuImages/triangleIcon"));
            mouseCursor.resize(40, 40);
            startScreen.addComponent(mouseCursor);

            helpScreen.addComponent(mouseCursor);
            optionsScreen.addComponent(mouseCursor);
            creditsScreen.addComponent(mouseCursor);
            newGameScreen.addComponent(mouseCursor);
            winlossScreen.addComponent(mouseCursor);
            gameInterfaceScreen.addComponent(mouseCursor);
            GameUI.tutorialScreen.instance.menuPanelTutorial.addComponent(mouseCursor);
            setGameState(GameState.splash);
            Chicken.AudioManager.instance.roosterSpawnSound.Play(0.3f,0f,0f);
        }