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------------- }
/// <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); }