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