protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); IsMouseVisible = true; font1 = Content.Load<SpriteFont>("Basic"); UI = new UserInterface(spriteBatch, graphics, Content.Load<Texture2D>("right"), Content.Load<Texture2D>("left"), Content.Load<Texture2D>("platform"), Content.Load<Texture2D>("right"), Content.Load<Texture2D>("menubar")); //buttons graphics.ApplyChanges(); btnPlay = new cButton(Content.Load<Texture2D>("game"), graphics.GraphicsDevice); start = new cButton(Content.Load<Texture2D>("game"), graphics.GraphicsDevice); btnScores = new cButton(Content.Load<Texture2D>("scores"), graphics.GraphicsDevice); exit = new cButton(Content.Load<Texture2D>("exit"), graphics.GraphicsDevice); menu = new cButton(Content.Load<Texture2D>("menu"), graphics.GraphicsDevice); getHint = new cButton(Content.Load<Texture2D>("hint"), graphics.GraphicsDevice); buyArrows = new cButton(Content.Load<Texture2D>("arrow"), graphics.GraphicsDevice); btnPlay.setPosition(new Vector2(350, 300)); btnScores.setPosition(new Vector2(350, 330)); exit.setPosition(new Vector2(350, 390)); menu.setPosition(new Vector2(350, 360)); start.setPosition(new Vector2(350, 350)); getHint.setPosition(new Vector2(GraphicsDevice.Viewport.Width * 7 / 8, 0)); buyArrows.setPosition(new Vector2(GraphicsDevice.Viewport.Width *7 / 8, 20)); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here Resources.LoadContent(Content); Main = new GameMain(); // Pause pausedTexture = Content.Load<Texture2D>("Paused"); pausedRectangle = new Rectangle((int)(camera.centre.X - pausedTexture.Width / 2), (int)(camera.centre.Y - pausedTexture.Height / 2), pausedTexture.Width, pausedTexture.Height); btnPlay = new Button(); playTexture = Content.Load<Texture2D>("Play"); btnPlay.Load(playTexture, new Vector2(camera.centre.X - playTexture.Width / 2, camera.centre.Y - playTexture.Height / 2 - 150)); btnMulti = new Button(); multiTexture = Content.Load<Texture2D>("Multijoueur"); btnMulti.Load(multiTexture, new Vector2(camera.centre.X - multiTexture.Width / 2, camera.centre.Y - multiTexture.Height / 2 - 100)); btnQuit = new Button(); quitTexture = Content.Load<Texture2D>("Quit"); btnQuit.Load(quitTexture, new Vector2(camera.centre.X - quitTexture.Width / 2, camera.centre.Y - quitTexture.Height / 2 - 50)); // Music music = Content.Load<Song>("music"); MediaPlayer.Play(music); MediaPlayer.IsRepeating = true; //Menu graphics.ApplyChanges(); IsMouseVisible = true; btnplaymenu = new cButton(Content.Load<Texture2D>(@"gfx/Button"), graphics.GraphicsDevice); btnplaymenu.setPosition(new Vector2(490, 370)); }