Blink.AudioManager.LoadContent C# (CSharp) Method

LoadContent() public static method

public static LoadContent ( Microsoft.Xna.Framework.Content.ContentManager Content ) : void
Content Microsoft.Xna.Framework.Content.ContentManager
return void
        public static void LoadContent(ContentManager Content)
        {
            menuLayer1 = Content.Load<SoundEffect>("audio/music/menu1").CreateInstance();
            menuLayer2 = Content.Load<SoundEffect>("audio/music/menu2").CreateInstance();
            // PLACEHOLDER
            battleMusic = Content.Load<SoundEffect>("audio/music/Drum_Loop").CreateInstance();
        }

Usage Example

Example #1
0
        /// <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);

            // Should probably be in Initialize, but screen size is updated after Initialize causing weird collision issues
            Vector2 screenSize = new Vector2(GraphicsDevice.Viewport.TitleSafeArea.Right, GraphicsDevice.Viewport.TitleSafeArea.Bottom);

            game        = new StateGame(screenSize);
            levelMenu   = new StateLevelSelect(screenSize, "Map Select", new string[] { "Start", "Start", "Quit" }, game);
            creditsMenu = new StateCredits(screenSize, "Credits", new string[] { "Menu" });
            charMenu    = new StateCharacterSelect(screenSize, "Character Select", levelMenu, game);
            //mainMenu = new StateSimpleMenu(screenSize, "Blink", new string[] { "Start", "Credits", "Quit" }, new GameState[] { charMenu, creditsMenu, new StateQuit() });
            mainMenu  = new StateMainMenu(screenSize, new GameState[] { charMenu, creditsMenu, new StateQuit() });
            winScreen = new StateWin(screenSize);
            ((StateGame)game).levelSelect = levelMenu;
            ((StateGame)game).Win         = winScreen;
            ((StateCredits)creditsMenu).getMenu(mainMenu);
            ((StateLevelSelect)levelMenu).prevState = charMenu;
            ((StateWin)winScreen).levelSelect       = levelMenu;
            currState = mainMenu;
            currState.Initialize();
            currState.LoadContent(Content);
            AudioManager.LoadContent(Content);
        }