Example #1
0
        public VictoryLossScreen(int w, int h, ContentManager _content)
            : base(0, 0, w, h)
        {
            instance = this;
            content = _content;
            int verticalSpacing = 100;
            victoryloss = new UI.ImageLabel(0, 0, content.Load<Texture2D>("menuImages/splashScreen"));
            addComponent(victoryloss);
            victoryloss.resize(rect.Width, rect.Height);
            Texture2D buttonUp = content.Load<Texture2D>("menuImages/blankbuttonGlow");
            Texture2D buttonDown = content.Load<Texture2D>("menuImages/blankButtonDarkGlow");

            UI.ImageLabel background = (new UI.ImageLabel(location.X + (verticalSpacing * 4)-20,
                location.Y + 100, content.Load<Texture2D>("menuImages/tutorialtipbox")));
            background.resize((victoryloss.getWidth() / 2) - 100, victoryloss.getHeight() - 200);
            addComponent(background);

            info = "Win/Loss";

            //UI.TextLabel title1 = new UI.TextLabel((rect.Width / 2) - 175, (rect.Height / 6),
            //this.getWidth() / 3, (int)(this.getHeight() * 0.10), "Game Credits", 1.0f, Color.White);
            //addComponent(title1);
            location = victoryloss.getPos();

            menuTitle = (new UI.ImageLabel(location.X + (verticalSpacing * 3)-20, location.Y - (verticalSpacing / 5),
                content.Load<Texture2D>("menuImages/M_wintitle")));
            menuTitle.scale(1);
            addComponent(menuTitle);
            title2 = new UI.TextLabel((rect.Width / 2) - 210, rect.Height / 3, this.getWidth() / 3,
                (int)(this.getHeight() * 0.10), info, 0.5f, Color.White);
            addComponent(title2);

            //UI.TextLabel keyText = new UI.TextLabel(rect.Width / 2, rect.Height - 50, 50, 15,
            //"Press any key to continue", Color.White);
            //addComponent(keyText);

            UI.PushButton myButton = new UI.PushButton((w/2) -( buttonUp.Width/2), (h - buttonUp.Height)
                / 2 + 300, buttonUp, buttonDown, "");// play again return to start
            addComponent(myButton);
            myButton.setClickEventHandler(onButtonClicked);

            location = myButton.getPos();
            //load the start font onto the button
            UI.TextLabel returnText = new UI.TextLabel(location.X, location.Y, buttonUp.Width, buttonUp.Height,
                "Continue", 0.5f, Color.White);
            addComponent(returnText);

            //gameEndFrames = new ArrayList();
            //gameEndFrames.Add(content.Load<Texture2D>("menu/torchIconC"));//default torches
            //gameEndFrames.Add(content.Load<Texture2D>("menu/torchIcon2C"));
            //gameEndFrames.Add(content.Load<Texture2D>("menu/torchIcon3C"));
            //gameEndFrames.Add(content.Load<Texture2D>("menu/torchIcon4C"));
            //gameEndFrames.Add(content.Load<Texture2D>("menu/torchIcon5C"));

            //gameEnd = new UI.Animation(50, gameEndFrames, true);
            //gameEnd.move(w / 2 -120,100);
            //addComponent(gameEnd);
        }
Example #2
0
 public Panel(int x, int y, Texture2D image,string _title)
     : base(x, y, image.Width, image.Height)
 {
     addComponent(new ImageLabel(x, y, image));
     title = new TextLabel(x, y + 10, image.Width, fontSize, _title, Color.Beige);
     addComponent(title); //change 20 to be font height
     description = new TextLabel(x, y + offsetData, image.Width, fontSize*4, "", Color.Beige);
     addComponent(description);
 }
Example #3
0
        public tutorialScreen(int w, int h, ContentManager content,
                            GraphicsDeviceManager _graphics)
            : base(0,0,w,h)
        {
            instance = this;
            graphicsH = _graphics.PreferredBackBufferHeight;
            graphicsW = _graphics.PreferredBackBufferWidth;
            //add the panels for the screen interfaces
            UI.ImageLabel tutorialBackground = new UI.ImageLabel
                                (0, _graphics.PreferredBackBufferHeight - panelHeight,
                                content.Load<Texture2D>("menuImages/gameInterfacePanel"));
            tutorialBackground.resize(_graphics.PreferredBackBufferWidth, panelHeight);
            addComponent(tutorialBackground);//panel across the bottom that says tutorial

             Point location = tutorialBackground.getPos();

             UI.ImageLabel tutorialTitle = new UI.ImageLabel(location.X, location.Y, content.Load<Texture2D>("menuImages/tutorialLeveltext"));
             addComponent(tutorialTitle);

             //tutorial header
             tutorialBoxHeader = new UI.ImageLabel((_graphics.PreferredBackBufferWidth / 4)+20, 20, content.Load<Texture2D>("menuImages/tutorialtipbox"));
             //tutorialBoxBackground.resize(panelWidth / 4, panelWidth / 3);
             tutorialBoxHeader.resize(panelWidth / 4, panelWidth / 15);
             addComponent(tutorialBoxHeader);

             location = tutorialBoxHeader.getPos();

             tutorialHeaderText = new UI.TextLabel(location.X, location.Y, tutorialBoxHeader.getWidth(), tutorialBoxHeader.getHeight(),tutorialHeader, Color.White);
             tutorialHeaderText.changeFontScale(0.3f);
             addComponent(tutorialHeaderText);

             //UI.TextLabel tutorialTitle = new UI.TextLabel(location.X, location.Y+20, 1280, 20, "Tutorial Level", Color.White);
             //tutorialTitle.changeFontScale(1);
             //addComponent(tutorialTitle);
             tutorialBoxBackground = new UI.ImageLabel(20, 20,content.Load<Texture2D>("menuImages/tutorialtipbox"));
             //tutorialBoxBackground.resize(panelWidth / 4, panelWidth / 3);
             tutorialBoxBackground.resize(panelWidth / 4, panelWidth / 8);
             addComponent(tutorialBoxBackground);

             location = tutorialBoxBackground.getPos();

            tutorialText = new UI.TextLabel(location.X,location.Y,tutorialBoxBackground.getWidth(), tutorialBoxBackground.getHeight(),tutorialInfo, Color.White);
            tutorialText.changeFontScale(0.3f);
             addComponent(tutorialText);

             menuPanelTutorial = new inGameMenu(w, h, content, _graphics);
             addComponent(menuPanelTutorial);
        }
Example #4
0
        public splashScreen(int w, int h, ContentManager content)
            : base(0, 0, w, h)
        {
            instance = this;
            UI.ImageLabel splashLogo = new UI.ImageLabel(0, 0, content.Load<Texture2D>
                                      ("menuImages/splashScreen[3]"));
            splashLogo.resize(rect.Width, rect.Height);
            addComponent(splashLogo);

            UI.TextLabel keyText = new UI.TextLabel(rect.Width/2, rect.Height-50, 50, 20,
                "**Press any key to continue**", Color.White);
            keyText.changeFontScale(0.5f);
            addComponent(keyText);
            gameStart = true;

            //this.visible = true;
        }
Example #5
0
        private int totalMoney; //total money after selling eggs

        #endregion Fields

        #region Constructors

        //button for interface, causes the in-game menu to display
        // private UI.PushButton menuButton;
        //button to hide this interface will be in the game-world. showInterface/hideInterface
        //this will allow players to remove the interface if it is in their view of eggs
        public gameInterface(int w, int h, ContentManager content,
                            GraphicsDeviceManager _graphics)
            : base(0,0,w,h)
        {
            instance = this;
            //updateStats();

            characterPicture = content.Load<Texture2D>("menuImages/farmerBoyImage");

             //add an additional panel to the gameInterface that holds the in-game Menu features
            menuPanel = new inGameMenu(w , h , content,_graphics);
            addComponent(menuPanel);

            //add an additional panel that displays the end of day summary
            summaryPanel = new EndDaySummary(w, h, content, _graphics);
            addComponent(summaryPanel);

            //winlossPanel = new VictoryLossScreen(w, h, content);
            //addComponent(winlossPanel);

            //initialize default summary page to timed goal intro
            //summaryPanel.setSummaryState(EndDaySummary.SummaryState.timedGoal);

            //add an additional panel that displays tutorial tips

             //add an additional panel to the gameInterface that displays a sun
                            //graphic to show time/day passing
            sunPanel = new sunPanel(w, h, content, _graphics);
            addComponent(sunPanel);

             //add the panels for the screen interfaces
            UI.ImageLabel gameInterfaceBackground = new UI.ImageLabel
                                (0, _graphics.PreferredBackBufferHeight-panelHeight,
                                content.Load<Texture2D>("menuImages/gameInterfacePanel"));
            gameInterfaceBackground.resize(_graphics.PreferredBackBufferWidth, panelHeight);
            addComponent(gameInterfaceBackground);//dark panel

             //variables to set alignment positions for panel components
            verticalSpacing = gameInterfaceBackground.getPos().Y+70;
            leftColumnMargin = gameInterfaceBackground.getPos().X;
            middleLeftColumnMargin = gameInterfaceBackground.getPos().X +
                                ((gameInterfaceBackground.getWidth()/2) -350);
            middleRightColumnMargin = gameInterfaceBackground.getPos().X +
                                ((gameInterfaceBackground.getWidth()/2) -50);
            rightColumnMargin = gameInterfaceBackground.getPos().X + (gameInterfaceBackground.getWidth());
            textLabelWidth = 150;

             //image Labels for the interface Panel, will each have an associated txt label to display values
            characterImage = new UI.ImageLabel(leftColumnMargin + 10, verticalSpacing -30,
                                characterPicture);
            characterImage.resize(50,50);
            addComponent(characterImage);

            Point location = characterImage.getPos(); //keeps track of where to set the text Label

             isEquippedText = new UI.TextLabel(location.X + characterImage.getWidth(), location.Y+30,
                                textLabelWidth, characterImage.getHeight(), "", 0.3f, Color.Yellow);
            addComponent(isEquippedText);
            //load the text next to the appropriate image
            characterHealthText = new UI.TextLabel(location.X + characterImage.getWidth(),
                                location.Y, textLabelWidth, characterImage.getHeight(),
                                "Health "+Convert.ToString(hitPoints)+" / " +
                                Convert.ToString(gameWorld.instance.myCharacter.maxHP),
                                0.3f, Color.White);
            addComponent(characterHealthText);

            UI.ImageLabel chickenImage = new UI.ImageLabel(middleLeftColumnMargin,
                                verticalSpacing, content.Load<Texture2D>("menuImages/chickenImage"));
            chickenImage.resize(40,40);
            addComponent(chickenImage);

            location = chickenImage.getPos();

            chickenNumberText = new UI.TextLabel(location.X + characterImage.getWidth(),
                                location.Y, textLabelWidth, chickenImage.getHeight(),
                                "Chickens " + Convert.ToString(chickenNumber) + " / " +
                                Convert.ToString(gameWorld.instance.maxChicken),
                                0.3f, Color.White);
            addComponent(chickenNumberText);

            UI.ImageLabel roosterImage = new UI.ImageLabel(middleLeftColumnMargin,
                                verticalSpacing - 50, content.Load<Texture2D>
                                ("menuImages/RoosterImage"));
            roosterImage.resize(40,40);
            addComponent(roosterImage);

            location = roosterImage.getPos();

            roosterNumberText = new UI.TextLabel(location.X + characterImage.getWidth(),
                                location.Y, textLabelWidth, chickenImage.getHeight(),
                                "Roosters " + Convert.ToString(roosterNumber) + " / " +
                                Convert.ToString(gameWorld.instance.maxRooster),
                                0.3f, Color.White);
            addComponent(roosterNumberText);

            UI.ImageLabel eggImage = new UI.ImageLabel(middleRightColumnMargin,
                                verticalSpacing -50, content.Load<Texture2D>
                                ("menuImages/eggImage"));
            eggImage.resize(30,30);
            addComponent(eggImage);

            location = eggImage.getPos();

            eggNumberText = new UI.TextLabel(location.X + characterImage.getWidth(),
                                location.Y, textLabelWidth, chickenImage.getHeight(),
                                "Eggs " + Convert.ToString(eggNumber) + " / Broken " +
                                Convert.ToString(brokenEggNumber), 0.3f, Color.White);
            addComponent(eggNumberText);

            UI.ImageLabel moneyImage = new UI.ImageLabel(middleRightColumnMargin,
                                verticalSpacing, content.Load<Texture2D>
                                ("menuImages/dollarSignImage"));
            moneyImage.resize(40,40);
            addComponent(moneyImage);

            location = moneyImage.getPos();

            moneyText = new UI.TextLabel(location.X + characterImage.getWidth(),
                                location.Y, textLabelWidth, chickenImage.getHeight(),
                                "  $ " + Convert.ToString(totalMoney) + " / Upkeep " +
                                Convert.ToString(farmUpkeep), 0.3f, Color.White);
            addComponent(moneyText);

            UI.ImageLabel sunImage = new UI.ImageLabel(rightColumnMargin - 400,
                                verticalSpacing - 50, content.Load<Texture2D>
                                ("menuImages/sunIcon"));
            sunImage.resize(40, 40);
            addComponent(sunImage);
            location = sunImage.getPos();

            sunText = new UI.TextLabel(location.X + characterImage.getWidth(), location.Y,
                                textLabelWidth, chickenImage.getHeight(), "Day light " +
                                Convert.ToString(daytimePast) + " / " + Convert.ToString
                                (gameWorld.instance.endDay), 0.3f, Color.White);
            addComponent(sunText);

            UI.ImageLabel goalImage = new UI.ImageLabel(rightColumnMargin -400, verticalSpacing,
                                content.Load<Texture2D>("menuImages/goalImage"));
            goalImage.resize(40, 40);
            addComponent(goalImage);

            location = goalImage.getPos();

            goalText = new UI.TextLabel(location.X + characterImage.getWidth(), location.Y,
                                textLabelWidth, chickenImage.getHeight(), "Goal Timer " +
                                Convert.ToString(goalAchievedT) + " / " + Convert.ToString
                                (gameWorld.instance.winLoss.timeWin), 0.3f, Color.White);
            addComponent(goalText);

            //add interactive buttons to the game screen
            UI.PushButton inGameMenuButton = new UI.PushButton(rightColumnMargin -
                                (buttonWidth)-20, verticalSpacing -
                                gameInterfaceBackground.getHeight()/2,
                                content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
                                content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
                                "");
            inGameMenuButton.resize(buttonWidth, buttonHeight);
            addComponent(inGameMenuButton);
            inGameMenuButton.setClickEventHandler(inGameMenuClicked);

             //local variable to set button positions
            Point location_L = inGameMenuButton.getPos(); //keeps track of spacing on the Left side of the menu
            Point location_R = inGameMenuButton.getPos();//keeps track of spacing on the Right side of the menu

             //load the text onto the button so the size is appropriate for the button
             //activate this menu with M or assigned xbox control
            UI.TextLabel inGameMenuText = new UI.TextLabel(location_L.X - 10, location_L.Y,
                                inGameMenuButton.getWidth(), inGameMenuButton.getHeight(),
                                "  Menu<M>", 0.3f, Color.White);
             addComponent(inGameMenuText);

             foxWarning = new UI.ImageLabel(_graphics.PreferredBackBufferWidth/2-50, _graphics.PreferredBackBufferHeight/10
                                            , content.Load<Texture2D>("menuImages/foxWarning"));
             foxWarning.resize(100, 100);
             addComponent(foxWarning);
             foxWarning.visible = false;
        }
Example #6
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;
        }
Example #7
0
        public optionsMenuScreen(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")));
            //barnSidewithGlow/chickenCoopMenuPoster optional
            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);

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

               UI.PushButton startButton = new UI.PushButton(((backGroundImage.getWidth()/2)-(buttonUp.Width/2)),
               (backGroundImage.getHeight() - (buttonUp.Height*2)), buttonUp, buttonDown, "");//return to start

            addComponent(startButton);
               startButton.setClickEventHandler(startButtonClicked);
               Point startButtonlocation = startButton.getPos();
               ////load the start font onto the button
               UI.TextLabel startText = new UI.TextLabel(startButtonlocation.X, startButtonlocation.Y, startButton.getWidth(),
                                  startButton.getHeight(), "Return to Start", 0.5f, Color.White);
               addComponent(startText);

             //group 1 Screen Options
               ArrayList optionGroup1 = new ArrayList();
               windowedChecked = new UI.CheckBox(columnLeft+20, location.Y+(verticalSpacing*2), checkedImage, unCheckedImage,
               " Windowed Mode", true);
               windowedChecked.changeFontScale(fontScale);
               addComponent(windowedChecked);
               fullScreenChecked = new UI.CheckBox(columnLeft + 20, location.Y + (verticalSpacing * 3), checkedImage,
               unCheckedImage, "Full Screen Mode", false);
               fullScreenChecked.changeFontScale(fontScale);
               addComponent(fullScreenChecked);

               optionGroup1.Add(windowedChecked);
               optionGroup1.Add(fullScreenChecked);
               windowedChecked.buttonGroup = optionGroup1;
               fullScreenChecked.buttonGroup = optionGroup1;

            //group 2 Audio Options
              // ArrayList optionGroup2 = new ArrayList();
               musicChecked = new UI.CheckBox(columnLeft + 20, location.Y + (verticalSpacing * 4), checkedImage, unCheckedImage,
               "  Music ON/OFF", true);
               musicChecked.changeFontScale(fontScale);
               addComponent(musicChecked);
               soundEffectsChecked = new UI.CheckBox(columnLeft + 20, location.Y + (verticalSpacing * 5), checkedImage,
               unCheckedImage, "   SFX ON/OFF", true);
               soundEffectsChecked.changeFontScale(fontScale);
               addComponent(soundEffectsChecked);
               //--------------------------------------------------------------if we end up with 1 options menu-------------
               //optionGroup2.Add(musicChecked);
               //optionGroup2.Add(soundEffectsChecked);
               //musicChecked.buttonGroup = optionGroup2;
               //soundEffectsChecked.buttonGroup = optionGroup2;

            //group 3 character Options
               //ArrayList optionGroup3 = new ArrayList();
               //UI.CheckBox maleChecked = new UI.CheckBox(columnRight + 20, location.Y + (verticalSpacing ),
               //checkedImage, unCheckedImage, "Male Character", true);
               //maleChecked.changeFontScale(fontScale);
               //addComponent(maleChecked);
               //UI.CheckBox femaleChecked = new UI.CheckBox(columnRight + 20, location.Y + (verticalSpacing * 2),
               //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();
               //UI.CheckBox timedChecked = new UI.CheckBox(columnRight + 20, location.Y + (verticalSpacing * 3), checkedImage,
               //unCheckedImage, "Timed Game Victory", true);
               //timedChecked.changeFontScale(fontScale);
               //addComponent(timedChecked);
               //UI.CheckBox monetaryChecked = new UI.CheckBox(columnRight + 20, location.Y + (verticalSpacing * 4), checkedImage,
               //unCheckedImage, "Bank Payoff Victory", false);
               //monetaryChecked.changeFontScale(fontScale);
               //addComponent(monetaryChecked);

               //optionGroup4.Add(timedChecked);
               //optionGroup4.Add(monetaryChecked);
               //timedChecked.buttonGroup = optionGroup4;
               //monetaryChecked.buttonGroup = optionGroup4;
               //-----------------------------------------------------------if we end up with 1 options menu-------------
        }
Example #8
0
        public inGameMenu(int w, int h, ContentManager content,
                            GraphicsDeviceManager _graphics)
            : base(0,0,w,h)
        {
            instance = this;
            this.visible = false;
             //assign variables from the economics class
            chickenCost = gameWorld.instance.player.chickenCost;
            chickenSell = gameWorld.instance.player.chickenSell;
            roosterCost = gameWorld.instance.player.roosterCost;
            roosterSell = gameWorld.instance.player.roosterSell;
            eggSell = gameWorld.instance.player.eggSell;
            eggSellEnd = gameWorld.instance.player.eggSellEnd;
            UI.ImageLabel menuBackground = new UI.ImageLabel((w/4), 80,
                            content.Load<Texture2D>("menuImages/chickenCoopMenuPoster"));
            menuBackground.resize(rect.Width/2, rect.Height-200);
            addComponent(menuBackground);//add a background image for the menu system

            UI.ImageLabel inGameMenu = new UI.ImageLabel((w/4)+100, 130,
                                content.Load<Texture2D>("menuImages/tutorialtipbox"));
            inGameMenu.resize(menuBackground.getWidth()-200,menuBackground.getHeight()-100);
            addComponent(inGameMenu);//add a panel to the image for button placement

            leftColumnMargin = inGameMenu.getPos().X +(buttonHeight/2);
            //rightColumnMargin = (inGameMenu.getPos().X + buttonHorizontalSpacing;
            middleColumnMargin = (inGameMenu.getPos().X + (inGameMenu.getWidth() / 2));
            //world = new gameWorld(w, h, content,_graphics,gameTime);
            //addComponent(world);
             //add the gameworld object to the display list

             //add interactive buttons to the game screen
             //purchase/buy on the Left, Sell on the right. Play at the top. Save/Start/Quit on the bottom row

            UI.PushButton returnToPlayButton = new UI.PushButton(middleColumnMargin-
                            (buttonWidth/2), 115,
                            content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
                            content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
                                                                 "");
            returnToPlayButton.resize(buttonWidth, buttonHeight);
            addComponent(returnToPlayButton);
            returnToPlayButton.setClickEventHandler(returnToPlayClicked);

             //local variable to set button positions
            Point location_L = returnToPlayButton.getPos(); //keeps track of spacing on the Left side of the menu
             Point location_R = returnToPlayButton.getPos();//keeps track of spacing on the Right side of the menu

             //load the text onto the button so the size is appropriate for the button
             UI.TextLabel playText = new UI.TextLabel(location_L.X, location_L.Y,
                                returnToPlayButton.getWidth(),
                                returnToPlayButton.getHeight(), "Resume Game", 0.3f, Color.White);
             addComponent(playText);

             //a button to hide the menu system when X is clicked
             UI.PushButton hideMenuButton = new UI.PushButton((inGameMenu.getPos().X +
                                inGameMenu.getWidth()) - (buttonHeight), inGameMenu.getPos().Y
                                - (buttonHeight / 2),
                                content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
                                content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
                                "");
             hideMenuButton.resize(buttonHeight,buttonHeight);
             //addComponent(hideMenuButton);
             hideMenuButton.setClickEventHandler(hideMenuClicked);
             location_R = hideMenuButton.getPos();
             UI.TextLabel hideMenuText = new UI.TextLabel(location_R.X, location_R.Y,
                                hideMenuButton.getWidth(), hideMenuButton.getHeight(),
                                "X", 0.3f, Color.White);
            // addComponent(hideMenuText); remove this button

             //v2.0 speckled rooster addition
            //UI.PushButton buySpeckledRoosterButton = new UI.PushButton(menuBackground.getWidth()
            //              / 2 - (buttonHorizontalSpacing), menuBackground.getHeight() + (panelGap * 2),
            //              content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
            //              content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
            //              "Buy Rooster");
            //buySpeckledRoosterButton.resize(buttonWidth, buttonHeight);
            //addComponent(buySpeckledRoosterButton);
            //buySpeckledRoosterButton.setClickEventHandler(buySpeckledRoosterClicked);
             UI.PushButton eatEggButton = new UI.PushButton(leftColumnMargin,
                                (location_R.Y + buttonVerticalSpacing),
                                content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
                                content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
                                "");
             eatEggButton.resize(buttonWidth, buttonHeight);
             addComponent(eatEggButton);
             eatEggButton.setClickEventHandler(eatEggClicked);

             //local variable to set button positions
             location_L = eatEggButton.getPos(); //keeps track of spacing on the Left side of the menu

             //load the text onto the button so the size is appropriate for the button
             UI.TextLabel eatEggText = new UI.TextLabel(location_L.X, location_L.Y,
                            eatEggButton.getWidth(),
                            eatEggButton.getHeight(), "Eat Egg", 0.3f, Color.White);
             addComponent(eatEggText);

            UI.PushButton sellEggsButton = new UI.PushButton(middleColumnMargin,
                            (location_R.Y+buttonVerticalSpacing) ,
                             content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
                             content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
                             "");
            sellEggsButton.resize(buttonWidth, buttonHeight);
            addComponent(sellEggsButton);
            sellEggsButton.setClickEventHandler(sellEggClicked);
            location_R = sellEggsButton.getPos();
            sellEggsText = new UI.TextLabel(location_R.X, location_R.Y, sellEggsButton.getWidth(),
                             sellEggsButton.getHeight(), "Sell Eggs $" + Convert.ToString(eggSell),
                             0.3f, Color.White);
            addComponent(sellEggsText);

            UI.PushButton buyChickenButton = new UI.PushButton(leftColumnMargin,
                            (location_R.Y + buttonVerticalSpacing),
                             content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
                             content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
                             "");
            buyChickenButton.resize(buttonWidth, buttonHeight);
            addComponent(buyChickenButton);
            buyChickenButton.setClickEventHandler(buyChickenClicked);

            location_L = buyChickenButton.getPos();

            UI.TextLabel buyChickenText = new UI.TextLabel(location_L.X, location_L.Y,
                             buyChickenButton.getWidth(),
                             buyChickenButton.getHeight(), "Buy Chicken $" +
                             Convert.ToString(chickenCost), 0.3f, Color.White);
            addComponent(buyChickenText);
            //v2.0 variety chicken colors for purchase
            //UI.PushButton buyRedChickenButton = new UI.PushButton(menuBackground.getWidth()
            //               / 2 - (buttonHorizontalSpacing), menuBackground.getHeight() + (panelGap * 2),
            //               content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
            //               content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
            //               "Buy Chicken");
            //buyRedChickenButton.resize(buttonWidth, buttonHeight);
            //addComponent(buyRedChickenButton);
            //buyRedChickenButton.setClickEventHandler(buyRedChickenClicked);

            //UI.PushButton buyGoldChickenButton = new UI.PushButton(menuBackground.getWidth()
            //               / 2 - (buttonHorizontalSpacing), menuBackground.getHeight() + (panelGap * 2),
            //               content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
            //               content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
            //               "Buy Chicken");
            //buyGoldChickenButton.resize(buttonWidth, buttonHeight);
            //addComponent(buyGoldChickenButton);
            //buyChickenButton.setClickEventHandler(buyGoldChickenClicked);

            UI.PushButton buyRoosterButton = new UI.PushButton(leftColumnMargin,
                                (location_L.Y + buttonVerticalSpacing),
                                content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
                                content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
                                "");
            buyRoosterButton.resize(buttonWidth, buttonHeight);
            addComponent(buyRoosterButton);
            buyRoosterButton.setClickEventHandler(buyRoosterClicked);

            location_L = buyRoosterButton.getPos();
            UI.TextLabel buyRoosterText = new UI.TextLabel(location_L.X, location_L.Y,
                                buyRoosterButton.getWidth(),
                                buyRoosterButton.getHeight(), "Buy Rooster $" +
                                Convert.ToString(roosterCost), 0.3f, Color.White);
            addComponent(buyRoosterText);

            UI.PushButton sellChickenButton = new UI.PushButton(middleColumnMargin,
                                (location_R.Y+buttonVerticalSpacing),
                                content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
                                content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
                                "");
            sellChickenButton.resize(buttonWidth, buttonHeight);
            addComponent(sellChickenButton);
            sellChickenButton.setClickEventHandler(sellChickenClicked);
            location_R = sellChickenButton.getPos();
            UI.TextLabel sellChickenText = new UI.TextLabel(location_R.X, location_R.Y,
                                sellChickenButton.getWidth(),
                                sellChickenButton.getHeight(), "Sell Chicken $" +
                                Convert.ToString(chickenSell), 0.3f, Color.White);
            addComponent(sellChickenText);

            UI.PushButton sellRoosterButton = new UI.PushButton(middleColumnMargin,
                                (location_R.Y+buttonVerticalSpacing),
                                content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
                                content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
                                "");
            sellRoosterButton.resize(buttonWidth, buttonHeight);
            addComponent(sellRoosterButton);
            sellRoosterButton.setClickEventHandler(sellRoosterClicked);
            location_R = sellRoosterButton.getPos();
            UI.TextLabel sellRoosterText = new UI.TextLabel(location_R.X, location_R.Y,
                                sellRoosterButton.getWidth(),
                                sellRoosterButton.getHeight(), "Sell Rooster $" +
                                Convert.ToString(roosterSell), 0.3f, Color.White);
            addComponent(sellRoosterText);

            UI.PushButton saveGameButton = new UI.PushButton(leftColumnMargin,
                                (location_R.Y+buttonVerticalSpacing),
                                content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
                                content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
                                "");
            saveGameButton.resize(buttonWidth, buttonHeight);
            //addComponent(saveGameButton);
            saveGameButton.setClickEventHandler(saveClicked);
            location_R = saveGameButton.getPos();
            UI.TextLabel saveGameText = new UI.TextLabel(location_R.X, location_R.Y,
                                saveGameButton.getWidth(),
                                saveGameButton.getHeight(), "Save Game", 0.3f, Color.White);
            //addComponent(saveGameText);

            UI.PushButton returnToStartButton = new UI.PushButton(middleColumnMargin, location_R.Y,
                                content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
                                content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
                                "");
            returnToStartButton.resize(buttonWidth, buttonHeight);
            //addComponent(returnToStartButton);
            returnToStartButton.setClickEventHandler(returnToStartClicked);

            location_R = returnToStartButton.getPos();

            UI.TextLabel returnToStartText = new UI.TextLabel(location_R.X, location_R.Y,
                                returnToStartButton.getWidth(),
                                returnToStartButton.getHeight(), "Return To Start", 0.3f,
                                Color.White);
               // addComponent(returnToStartText);

            UI.PushButton quitGameButton = new UI.PushButton(middleColumnMargin -
                                (buttonWidth / 2), (location_R.Y+buttonVerticalSpacing),
                                content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
                                content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
                                "");
            quitGameButton.resize(buttonWidth, buttonHeight);
            addComponent(quitGameButton);
            quitGameButton.setClickEventHandler(quitClicked);
            location_R = quitGameButton.getPos();
            UI.TextLabel quitGameText = new UI.TextLabel(location_R.X, location_R.Y,
                                quitGameButton.getWidth(),
                                quitGameButton.getHeight(), "Save / Quit Game", 0.3f,
                                Color.White);
            addComponent(quitGameText);
            //statPanel = new StatsPanel(w - panelWidth - panelGap, h - panelHeight - panelGap, content);
            //addComponent(statPanel);
            pausedText = new UI.TextLabel(menuBackground.getPos().X+
                                (menuBackground.getWidth()/2)-150, menuBackground.getPos().Y - 100,
                                menuBackground.getWidth() / 2, 100, "***Game Paused***", Color.Red);
            addComponent(pausedText);
        }
Example #9
0
        //private string summaryInfoTwo = "Amount";
        public EndDaySummary(int w, int h, ContentManager content, GraphicsDeviceManager _graphics)
            : base(0, 0, w, h)
        {
            instance = this;
            this.visible = false;
            //assign variables from the economics class

            UI.ImageLabel menuBackground = new UI.ImageLabel((w / 4), 80, content.Load<Texture2D>
                                                             ("menuImages/chickenCoopMenuPoster"));
            menuBackground.resize(rect.Width / 2, rect.Height - 200);
            addComponent(menuBackground);//add a background image for the menu system

            UI.ImageLabel inGameMenu = new UI.ImageLabel((w / 4) + 100, 130, content.Load<Texture2D>
                                        ("menuImages/tutorialtipbox"));
            inGameMenu.resize(menuBackground.getWidth() - 200, menuBackground.getHeight() - 100);
            addComponent(inGameMenu);//add a panel to the image for button placement

            leftColumnMargin = inGameMenu.getPos().X + 80;
            rightColumnMargin = inGameMenu.getPos().X + (inGameMenu.getWidth())-(buttonHorizontalSpacing*2);
            middleColumnMargin = (inGameMenu.getPos().X + (inGameMenu.getWidth() / 2));
            //world = new gameWorld(w, h, content,_graphics,gameTime);
            //addComponent(world);
            //add the gameworld object to the display list

            //add interactive buttons to the game screen
            //purchase/buy on the Left, Sell on the right. Play at the top. Save/Start/Quit on the bottom row

            UI.PushButton returnToPlayButton = new UI.PushButton(middleColumnMargin - (buttonWidth / 2), 115,
                                     content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
                                     content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
                                     "");
            returnToPlayButton.resize(buttonWidth, buttonHeight);
            addComponent(returnToPlayButton);
            returnToPlayButton.setClickEventHandler(returnToPlayClicked);

            //local variable to set button positions
            Point location_L = returnToPlayButton.getPos(); //keeps track of spacing on the Left side of the menu
            Point location_R = returnToPlayButton.getPos();//keeps track of spacing on the Right side of the menu

            //load the text onto the button so the size is appropriate for the button
            UI.TextLabel playText = new UI.TextLabel(location_L.X, location_L.Y, returnToPlayButton.getWidth(),
                                    returnToPlayButton.getHeight(), "Resume Game", 0.3f, Color.White);
            addComponent(playText);

            //a button to hide the menu system when X is clicked
            summaryTitle = new UI.TextLabel(middleColumnMargin, (location_R.Y + 55), 10, 10, summaryHeader,
                                    0.35f, Color.White);
            addComponent(summaryTitle);
            summaryTextItem = new UI.TextLabel(leftColumnMargin+50, (location_R.Y + buttonVerticalSpacing),
                                    100, 300, summaryInfoOne, 0.3f, Color.White);
            addComponent(summaryTextItem);
            //creates a seperate column for entering summary information
            //summaryTextAmount = new UI.TextLabel(rightColumnMargin, (location_R.Y + buttonVerticalSpacing),
                                    //10, 10, summaryInfoTwo, 0.3f, Color.White);
            //addComponent(summaryTextAmount);

            UI.PushButton menuButton = new UI.PushButton(location_L.X, (location_L.Y + buttonVerticalSpacing*5),
                                     content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
                                     content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
                                     "");
            menuButton.resize(buttonWidth, buttonHeight);
            addComponent(menuButton);
            menuButton.setClickEventHandler(menuClicked);
            location_R = menuButton.getPos();
            UI.TextLabel menuText = new UI.TextLabel(location_R.X, location_R.Y, menuButton.getWidth(),
                                     menuButton.getHeight(), "Resource Menu", 0.3f, Color.White);
            addComponent(menuText);

            pausedText = new UI.TextLabel(menuBackground.getPos().X + (menuBackground.getWidth() / 2)
                                    - 150, menuBackground.getPos().Y - 100, menuBackground.getWidth()
                                    / 2, 100, "***Game Paused***", Color.Red);
            addComponent(pausedText);

            setSummaryState(SummaryState.timedGoal);//default start summary is timed goal intro
            updateSummary();

            //---------------------DebugButton------------------------------------
            //UI.PushButton debugButton = new UI.PushButton(location_R.X-450, (location_L.Y + buttonVerticalSpacing*3),
            //                                              content.Load<Texture2D>("MenuImages/blankbuttonGlow"),
            //                                              content.Load<Texture2D>("MenuImages/blankbuttonDarkGlow"),
            //                                              "Debug");

            //addComponent(debugButton);
            //debugButton.setClickEventHandler(debugClicked);
            //---------------------DebugButton------------------------------------
        }
Example #10
0
        //public bool gameIsStarted = false;
        //private ArrayList helpInfo;
        public helpScreen(int w, int h, ContentManager content)
            : base(0, 0, w, h)
        {
            UI.ImageLabel helpScreen = new UI.ImageLabel(0, 0, content.Load<Texture2D>
                                ("menuImages/barnSidewithGlow"));
            helpScreen.resize(rect.Width, rect.Height);
            addComponent(helpScreen);

            gameInfo = new UI.TextLabel((rect.Width / 2)-175, (rect.Height / 2),
                                helpScreen.getWidth() / 3, (int)(helpScreen.getHeight() * 0.10),
                                "", 0.3f, Color.White);
            addComponent(gameInfo);

            displayHelp();

            //UI.TextLabel title2 = new UI.TextLabel((rect.Width / 2)-175, rect.Height / 3,
                                //helpScreen.getWidth() / 3, (int)(helpScreen.getHeight() * 0.10),
                                //"Tutorial", 1.0f, Color.White);
            //addComponent(title2);

            Texture2D buttonUp = content.Load<Texture2D>("menuImages/blankbuttonGlow");
            Texture2D buttonDown = content.Load<Texture2D>("menuImages/blankButtonDarkGlow");
            //Texture2D previousUp = content.Load<Texture2D>("menu/previousUp");
            //Texture2D previousDown = content.Load<Texture2D>("menu/previousDown");
            //Texture2D nextUp = content.Load<Texture2D>("menu/nextUp");
            //Texture2D nextDown = content.Load<Texture2D>("menu/nextDown");
            location = helpScreen.getPos();
            int verticalSpacing = 100;

            UI.ImageLabel menuTitle = (new UI.ImageLabel(location.X + (verticalSpacing*4),
                                    location.Y-(verticalSpacing/2),
                                    content.Load<Texture2D>("menuImages/M_helptitle")));
            menuTitle.scale(1);
            addComponent(menuTitle);

            UI.PushButton returnButton = new UI.PushButton((w / 2) - 150, (h / 2 + 275),
                                    buttonUp, buttonDown, "");

            addComponent(returnButton);
            returnButton.setClickEventHandler(onButtonClicked);

            location = returnButton.getPos();
            //load the start font onto the button
            UI.TextLabel returnText = new UI.TextLabel(location.X, location.Y, buttonUp.Width,
                                    buttonUp.Height, "Return To Start", 0.4f, Color.White);

            addComponent(returnText);
            //arrow buttons to navigate the menu until character input is recognized
            Texture2D arrowUpLeft = content.Load<Texture2D>("menuImages/arrowLeft");
            Texture2D arrowDownLeft = content.Load<Texture2D>("menuImages/arrowLeftDown");
            Texture2D arrowUpRight = content.Load<Texture2D>("menuImages/arrowRight");
            Texture2D arrowDownRight = content.Load<Texture2D>("menuImages/arrowRightDown");

            UI.PushButton next = new UI.PushButton(location.X + arrowUpRight.Width + 30,
                                    location.Y+6, arrowUpRight, arrowDownRight, "");
            // Next scroll through text pages
            next.resize(40, 40);
            addComponent(next);
            next.setClickEventHandler(onNextClicked);

            UI.PushButton previous = new UI.PushButton(location.X - 70, location.Y + 6,
                                    arrowUpLeft, arrowDownLeft, "");
            //Previous scroll through text pages
            previous.resize(40, 40);
            addComponent(previous);
            previous.setClickEventHandler(onPreviousClicked);

            //playButton = new UI.PushButton((w / 2) - 150, (h / 2 - 350), buttonUp, buttonDown, "");

            //addComponent(playButton);
            //returnButton.setClickEventHandler(playClicked);

            //location = playButton.getPos();
            ////load the start font onto the button
            //playText = new UI.TextLabel(location.X, location.Y, buttonUp.Width, buttonUp.Height,
                                        //"Resume Game", 0.4f, Color.White);

            //addComponent(playText);

            //playButton.visible = gameIsStarted;
            //playText.visible = gameIsStarted;

            //gameInfo = new UI.TextLabel(0, 200, w, 50, "Click Next to Begin Instructions", Color.Beige);
            //addComponent(gameInfo);
        }
Example #11
0
        public startMenuScreen(int w, int h, ContentManager content)
            : base(0, 0, w, h)
        {
            instance = this;
            int verticalSpacing, buttonStartY;
            UI.ImageLabel startMenu = new UI.ImageLabel(0, 0, content.Load<Texture2D>
                                        ("menuImages/menuBackgroundTransTest5 copy"));
            startMenu.resize(rect.Width, rect.Height);
            addComponent(startMenu);
             //add title text
            //UI.TextLabel title1 = new UI.TextLabel((int)(rect.Width*0.10),rect.Height -
                                       // (rect.Height-30), startMenu.getWidth()/3,(int)
                                       // (startMenu.getHeight()*0.10), "Chicken", 1.0f, Color.White);
            //addComponent(title1);
            //UI.TextLabel title2 = new UI.TextLabel((int)(rect.Width * 0.5), rect.Height -
                                        //(rect.Height - 30), startMenu.getWidth() / 3, (int)
                                        //(startMenu.getHeight() * 0.10), "Rancher", 1.0f, Color.White);
            //addComponent(title2);

             //load 2d textures for title animation
            titleTextFrames = new ArrayList();
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleText"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleText"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleTextSmall"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleTextBig"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleText"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleText"));

            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleTextSmall"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleTextBig"));

            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleSpell0"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleSpell1"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleSpell2"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleSpell3"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleSpell4"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleSpell5"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleSpell6"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleSpell7"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleSpell8"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleSpell9"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleSpell10"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleSpell11"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleSpell12"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleSpell13"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleTextSmall"));
            titleTextFrames.Add(content.Load<Texture2D>("MenuImages/titleTextBig"));

            //add buttons
            Texture2D buttonUp = content.Load<Texture2D>("menuImages/blankbuttonGlow");
            // UI.TextLabel startText = new UI.Text
            Texture2D buttonDown = content.Load<Texture2D>("menuImages/blankbuttonDarkGlow");
            verticalSpacing = 100;
            buttonStartY = (h - buttonUp.Height) / 4;

            UI.PushButton newGameButton = new UI.PushButton((w - buttonUp.Width - 75), buttonStartY,
                                 buttonUp, buttonDown, "");//options button
            addComponent(newGameButton);
            newGameButton.setClickEventHandler(newGameClicked);
            //load the options font onto the button
               Point location = newGameButton.getPos();
            UI.TextLabel newGameText = new UI.TextLabel(location.X, location.Y, buttonUp.Width,
                                    buttonUp.Height, "New Game", 0.75f, Color.White);
            addComponent(newGameText);

             //load the start button and event
            UI.PushButton startButton = new UI.PushButton((w - buttonUp.Width - 75),
                                    buttonStartY + verticalSpacing, buttonUp, buttonDown, "");
            addComponent(startButton);
            startButton.setClickEventHandler(onButtonClicked);

             //load a temp location variable
              location = startButton.getPos();
             //load the start font onto the button
             UI.TextLabel startText = new UI.TextLabel(location.X, location.Y, buttonUp.Width,
                                    buttonUp.Height, "Continue", 0.75f, Color.White);
             addComponent(startText);

             //load the NewGame button and event

             //load the options button and event
             UI.PushButton optionsButton = new UI.PushButton((w - buttonUp.Width - 75), buttonStartY + (verticalSpacing*2),
                                    buttonUp, buttonDown, "");//options button
            addComponent(optionsButton);
            optionsButton.setClickEventHandler(optionsClicked);
            //load the options font onto the button
            location = optionsButton.getPos();
            UI.TextLabel optionsText = new UI.TextLabel(location.X, location.Y, buttonUp.Width,
                                    buttonUp.Height, "Options", 0.75f, Color.White);
            addComponent(optionsText);

             //load the help button and event
            UI.PushButton helpButton = new UI.PushButton((w - buttonUp.Width) - 75,  buttonStartY + (verticalSpacing*3),
                                    buttonUp, buttonDown, "");//help button
            addComponent(helpButton);
            helpButton.setClickEventHandler(helpClicked);
            //load the help font onto the button
            location = helpButton.getPos();
            UI.TextLabel helpText = new UI.TextLabel(location.X, location.Y, buttonUp.Width, buttonUp.Height,
                                    "Help", 0.75f, Color.White);
            addComponent(helpText);

            UI.PushButton exitButton = new UI.PushButton((w - buttonUp.Width) - 75, buttonStartY + (verticalSpacing * 4),
                                buttonUp, buttonDown, "");//credits button
            addComponent(exitButton);
            exitButton.setClickEventHandler(exitClicked);
            //load the help font onto the button
            location = exitButton.getPos();
            UI.TextLabel exitText = new UI.TextLabel(location.X, location.Y, buttonUp.Width, buttonUp.Height,
                                    "Exit", 0.75f, Color.White);
            addComponent(exitText);

            UI.PushButton creditsButton = new UI.PushButton((w - buttonUp.Width) - 75, buttonStartY + (verticalSpacing * 5),
                                   buttonUp, buttonDown, "");//credits button
            addComponent(creditsButton);
            creditsButton.setClickEventHandler(creditsClicked);
            //load the help font onto the button
            location = creditsButton.getPos();
            UI.TextLabel creditsText = new UI.TextLabel(location.X, location.Y, buttonUp.Width, buttonUp.Height,
                                    "Credits", 0.75f, Color.White);
            addComponent(creditsText);

             //--------------------------------------------------------Debug
            // //debug test for other menu screens
            //UI.PushButton debugButton = new UI.PushButton((w - buttonUp.Width - 500), (h - buttonUp.Height) / 2,
            //                      buttonUp, buttonDown, "debug");
            //addComponent(debugButton);
            //debugButton.setClickEventHandler(debugClicked);
            // //--------------------------------------------------------Debug

            titleText = new UI.Animation(200, titleTextFrames, true);
            titleText.move((int)(rect.Width * 0.10), rect.Height - (rect.Height - 30));
            addComponent(titleText);
        }
Example #12
0
        public creditsScreen(int w, int h, ContentManager content)
            : base(0, 0, w, h)
        {
            instance = this;
            credits = new UI.ImageLabel(0, 0, content.Load<Texture2D>("menuImages/splashScreen"));
            addComponent(credits);
            credits.resize(rect.Width, rect.Height);
            Texture2D buttonUp = content.Load<Texture2D>("menuImages/blankbuttonGlow");
            Texture2D buttonDown = content.Load<Texture2D>("menuImages/blankButtonDarkGlow");

            creditsInfo = "TEAM HENPECKED"
                          + "\n\nKiera Valnes: Project Manager"
                          + "\nVanessa Lind: Assets Manager"
                          + "\nStephan Murray: Lead Programmer"
                          + "\n\nSPECIAL THANKS TO:"
                          + "\n\nWEBSITE CREATOR:"
                          + "\nKimara Lind"
                          + "\n\nADVISORS:"
                          + "\nProf. Duncan, Prof. Bunge, "
                          + "Prof. Bahrt, Dean Thomas"
                          + "\n\nPRIMARY TESTERS:"
                          + "\nCody Dixon, AJ Hanson, Ben Siems";

            //UI.TextLabel title1 = new UI.TextLabel((rect.Width / 2) - 175, (rect.Height / 6),
                                    //this.getWidth() / 3, (int)(this.getHeight() * 0.10),
                                    //"Game Credits", 1.0f, Color.White);
            //addComponent(title1);
            location = credits.getPos();
            int verticalSpacing = 100;

            UI.ImageLabel background = (new UI.ImageLabel(location.X +(verticalSpacing * 4),
                                    location.Y+100, content.Load<Texture2D>("menuImages/tutorialtipbox")));
            background.resize((credits.getWidth()/2)-100, credits.getHeight()- 200);
            addComponent(background);
            UI.ImageLabel menuTitle = (new UI.ImageLabel(location.X + (verticalSpacing * 3),
                                    location.Y - (verticalSpacing / 5), content.Load<Texture2D>
                                    ("menuImages/M_creditstitle")));
            menuTitle.scale(1);
            addComponent(menuTitle);
            UI.TextLabel title2 = new UI.TextLabel((rect.Width / 2) - 175, (rect.Height / 2)-20,
                                    this.getWidth() / 3, (int)(this.getHeight() * 0.10), creditsInfo,
                                    0.3f, Color.White);
            addComponent(title2);

            UI.PushButton returnButton = new UI.PushButton((w/2) - (buttonUp.Width+50),
                                    (h - buttonUp.Height) / 2 + 300, buttonUp, buttonDown, "");
            addComponent(returnButton);
            returnButton.setClickEventHandler(playAgainClicked);// play again return to start

            location = returnButton.getPos();
            //load the start font onto the button
            UI.TextLabel returnText = new UI.TextLabel(location.X, location.Y, buttonUp.Width,
                                    buttonUp.Height, "Return To Start", 0.5f, Color.White);
            addComponent(returnText);

            UI.PushButton quitButton = new UI.PushButton((w / 2) + (buttonUp.Width/2),
                                    (h - buttonUp.Height) / 2 + 300, buttonUp, buttonDown, "");
            addComponent(quitButton);
            quitButton.setClickEventHandler(quitClicked);

            location = quitButton.getPos();
            //load the start font onto the button
            UI.TextLabel quitText = new UI.TextLabel(location.X, location.Y, buttonUp.Width,
                                    buttonUp.Height, "Quit Game", 0.5f, Color.White);
            addComponent(quitText);

            //gameEndFrames = new ArrayList();
            //gameEndFrames.Add(content.Load<Texture2D>("menu/torchIconC"));//default torches
            //gameEndFrames.Add(content.Load<Texture2D>("menu/torchIcon2C"));
            //gameEndFrames.Add(content.Load<Texture2D>("menu/torchIcon3C"));
            //gameEndFrames.Add(content.Load<Texture2D>("menu/torchIcon4C"));
            //gameEndFrames.Add(content.Load<Texture2D>("menu/torchIcon5C"));

            //gameEnd = new UI.Animation(50, gameEndFrames, true);
            //gameEnd.move(w / 2 -120,100);
            //addComponent(gameEnd);

            //credits = new UI.ImageLabel(300,200,content.Load<Texture2D>("menu/creditsText"));
            //addComponent(credits);
        }