• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Media.Song类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.Xna.Framework.Media.Song的典型用法代码示例。如果您正苦于以下问题:C# Song类的具体用法?C# Song怎么用?C# Song使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Song类属于Microsoft.Xna.Framework.Media命名空间,在下文中一共展示了Song类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Initialize

        /// <summary>
        /// Call this before using the manager.
        /// </summary>
        public void Initialize()
        {
#if MONOGL && WINDOWS
            //mMainMenuMusic = GameObjectManager.pInstance.pContentManager.Load<Song>("Audio\\Music\\MikeImmonen_Menu_Wave");
            //mGameplayMusic = GameObjectManager.pInstance.pContentManager.Load<Song>("Audio\\Music\\MikeImmonen_Gameplay_Wave");
#else
            mMainMenuMusic = GameObjectManager.pInstance.pContentManager.Load<Song>("Audio\\Music\\MikeImmonen_Menu");
            mGameplayMusic = GameObjectManager.pInstance.pContentManager.Load<Song>("Audio\\Music\\MikeImmonen_Gameplay");
#endif

            // All music in the game repeats.
            MediaPlayer.IsRepeating = true;

            mManualMusicDisabled = false;

#if (WINDOWS_PHONE && DEBUG) || (MONOGL && WINDOWS) || (__ANDROID__ && DEBUG)
            mDebugMusicDisabled = true; // We can't pass command line args to WP.
#else
            mDebugMusicDisabled = CommandLineManager.pInstance["DisableMusic"] != null;
#endif

            GameObjectManager.pInstance.RegisterUpdatePassChangeReceiver(this);

            ChangeMusic();
        }
开发者ID:vigomes03,项目名称:mbhswipetapsmash,代码行数:28,代码来源:MusicManager.cs


示例2: LoadContent

        public void LoadContent(ContentManager content)
        {
            this.sounds["Click"] = new List<SoundEffectInstance>();
            this.sounds["Click"].Add(content.Load<SoundEffect>("Sounds/Click").CreateInstance());

            this.backgroundMusic = content.Load<Song>("Sounds/BackgroundMusic");
        }
开发者ID:enliktjioe,项目名称:LudumDare24,代码行数:7,代码来源:SoundManagerView.cs


示例3: LoadContent

        public static void LoadContent(ContentManager Content)
        {
            //personnage
            joueur = Content.Load<Texture2D>("Sprite/Llama/llama");
            // menu
            jouer1 = Content.Load<Texture2D>("Sprite/Menu/jouer1");
            jouer2 = Content.Load<Texture2D>("Sprite/Menu/jouer2");
            options1 = Content.Load<Texture2D>("Sprite/Menu/Options1");
            options2 = Content.Load<Texture2D>("Sprite/Menu/Options2");
            quit1 = Content.Load<Texture2D>("Sprite/Menu/Quitter1");
            quit2 = Content.Load<Texture2D>("Sprite/Menu/Quitter2");
            fondMenu = Content.Load<Texture2D>("Sprite/Menu/fond");//ajouter un fond
            imageQuit = Content.Load<Texture2D>("Sprite/End");

            //options
            fondOptions = Content.Load<Texture2D>("Sprite/Background/OptionsBackground");
            marchearret = Content.Load<Texture2D>("Sprite/elementsOptions/marchearret");
            //Map
            grass = Content.Load<Texture2D>("Sprite/Background/grass");
            // Son
            song = Content.Load<Song>("Sons/menusong");
            effect = Content.Load<SoundEffect>("Sons/effectmenu");
            quiteffect = Content.Load<SoundEffect>("Sons/quiteffect");
            songtest = Content.Load<Song>("Sons/test");
        }
开发者ID:epillama,项目名称:projet_llama_game,代码行数:25,代码来源:Ressources.cs


示例4: Sounds

        public Sounds(Song song1, Song song2, Song song3, SoundEffect blimpEngineSound, SoundEffect explosionSound, SoundEffect failedSound,
            Song gameStartSound, SoundEffect playerEngineSound, SoundEffect rewardSound, SoundEffect shotSound)
        {
            level1Music = song1;
            level2Music = song2;
            level3Music = song3;
            MediaPlayer.IsRepeating = true;

            blimpEngineSE = blimpEngineSound;
            blimpEngineSEI = blimpEngineSE.CreateInstance();
            blimpEngineSEI.IsLooped = true;
            blimpEngineSEI.Pitch = 0.0f;
            blimpEngineSEI.Pan = 0.0f;

            missileEngineSE = blimpEngineSound;
            missileEngineSEI = missileEngineSE.CreateInstance();
            missileEngineSEI.IsLooped = true;
            missileEngineSEI.Pitch = 1.0f;
            missileEngineSEI.Pan = 0.0f;

            playerEngineSE = playerEngineSound;
            playerEngineSEI = playerEngineSE.CreateInstance();
            playerEngineSEI.IsLooped = true;
            playerEngineSEI.Pitch = -1.0f;

            explosionSE = explosionSound;
            failedSE = failedSound;
            gameStart = gameStartSound;
            rewardSE = rewardSound;
            shotSE = shotSound;
        }
开发者ID:Gillium,项目名称:spyrun,代码行数:31,代码来源:Sounds.cs


示例5: LoadContent

        public void LoadContent(ContentManager content)
        {
            this.sounds["FireMissile"] = new List<SoundEffectInstance>();
            this.sounds["FireMissile"].Add(content.Load<SoundEffect>("Sounds/Gun_NailRifle_Shot01").CreateInstance());
            this.sounds["FireMissile"].Add(content.Load<SoundEffect>("Sounds/Gun_NailRifle_Shot02").CreateInstance());
            this.sounds["FireMissile"].Add(content.Load<SoundEffect>("Sounds/Gun_NailRifle_Shot03").CreateInstance());
            this.sounds["FireMissile"].Add(content.Load<SoundEffect>("Sounds/Gun_NailRifle_Shot01").CreateInstance());
            this.sounds["FireMissile"].Add(content.Load<SoundEffect>("Sounds/Gun_NailRifle_Shot02").CreateInstance());
            this.sounds["FireMissile"].Add(content.Load<SoundEffect>("Sounds/Gun_NailRifle_Shot03").CreateInstance());
            this.sounds["FireMissile"].Add(content.Load<SoundEffect>("Sounds/Gun_NailRifle_Shot01").CreateInstance());
            this.sounds["FireMissile"].Add(content.Load<SoundEffect>("Sounds/Gun_NailRifle_Shot02").CreateInstance());
            this.sounds["FireMissile"].Add(content.Load<SoundEffect>("Sounds/Gun_NailRifle_Shot03").CreateInstance());

            this.sounds["MissileBounce"] = new List<SoundEffectInstance>();
            this.sounds["MissileBounce"].Add(content.Load<SoundEffect>("Sounds/Grenade_Bounce4").CreateInstance());
            this.sounds["MissileBounce"].Add(content.Load<SoundEffect>("Sounds/Grenade_Bounce5").CreateInstance());
            this.sounds["MissileBounce"].Add(content.Load<SoundEffect>("Sounds/Grenade_Bounce6").CreateInstance());
            this.sounds["MissileBounce"].Add(content.Load<SoundEffect>("Sounds/Grenade_Bounce7").CreateInstance());
            this.sounds["MissileBounce"].Add(content.Load<SoundEffect>("Sounds/Grenade_Bounce4").CreateInstance());
            this.sounds["MissileBounce"].Add(content.Load<SoundEffect>("Sounds/Grenade_Bounce5").CreateInstance());
            this.sounds["MissileBounce"].Add(content.Load<SoundEffect>("Sounds/Grenade_Bounce6").CreateInstance());
            this.sounds["MissileBounce"].Add(content.Load<SoundEffect>("Sounds/Grenade_Bounce7").CreateInstance());

            this.sounds["TankDestroyed"] = new List<SoundEffectInstance>();
            this.sounds["TankDestroyed"].Add(content.Load<SoundEffect>("Sounds/Hit_TruckSuspensionImpact1").CreateInstance());
            this.sounds["TankDestroyed"].Add(content.Load<SoundEffect>("Sounds/Hit_TruckSuspensionImpact2").CreateInstance());
            this.sounds["TankDestroyed"].Add(content.Load<SoundEffect>("Sounds/Hit_TruckSuspensionImpact3").CreateInstance());

            this.sounds["PlayerTankDestroyed"] = new List<SoundEffectInstance>();
            this.sounds["PlayerTankDestroyed"].Add(content.Load<SoundEffect>("Sounds/Robot_Death_Powerdown").CreateInstance());

            this.backgroundMusic = content.Load<Song>("Sounds/Chimera-Derivation-3");
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Volume = 0.25f;
        }
开发者ID:aschearer,项目名称:BaconGameJam2012,代码行数:35,代码来源:SoundManagerView.cs


示例6: AddMusic

 public void AddMusic(string name, bool isRepeating, float volume)
 {
     MediaPlayer.IsRepeating = true;
     MediaPlayer.Volume = 0.5f;
     songName = name;
     music = contentManager.Load<Song>(name);
 }
开发者ID:koniin,项目名称:Pong,代码行数:7,代码来源:SoundManager.cs


示例7: StopMusic

 public static void StopMusic(Song song)
 {
     if (currentSong != song)
     {
         MediaPlayer.Stop();
     }
 }
开发者ID:VolAnder123,项目名称:myWorks,代码行数:7,代码来源:MusicPlayer.cs


示例8: CustomInitialize

		void CustomInitialize()
		{
            this.EscogerChar.Visible = false;
            this.Sprite1.Visible = false;
            this.Sprite2.Visible = false;
            if (GlobalData.AI == false)
            {
                Entities.Kursor P1 = new Entities.Kursor(ContentManagerName);
                Entities.Kursor P2 = new Entities.Kursor(ContentManagerName);
                Cursores.Add(P1);
                Cursores.Add(P2);
            }
            else
            {
                Entities.Kursor P1 = new Entities.Kursor(ContentManagerName);
                Cursores.Add(P1);
            }
            seleccion1 = false;
            seleccion2 = false;

            Microsoft.Xna.Framework.Media.MediaPlayer.IsRepeating = true;
            song =
  FlatRedBallServices.Load<Song>(@"Content/intro", ContentManagerName);
            Microsoft.Xna.Framework.Media.MediaPlayer.Play(song);
           

		}
开发者ID:JdGXII,项目名称:EconoFight,代码行数:27,代码来源:CharSelect.cs


示例9: LoadContent

        public static void LoadContent()
        {
            MenuTapFX = Stuff.Content.Load<SoundEffect>("Sound\\MenuTap");
              BackgroundSong = Stuff.Content.Load<Song>("Sound\\BackgroundSong");
              EggBreakFX = Stuff.Content.Load<SoundEffect>("Sound\\EggBreak");
            CoinFX = Stuff.Content.Load<SoundEffect>("Sound\\Coin");

            HayFX = Stuff.Content.Load<SoundEffect>("Sound\\hay");

            SoundEffect TmpFX;
            for (int i = 1; i <= 8; i++)
            {
                TmpFX = Stuff.Content.Load<SoundEffect>("Sound\\pig" + i);
                PigFX.Add(TmpFX);
            }

            for (int i = 1; i <= 5; i++)
            {
                TmpFX = Stuff.Content.Load<SoundEffect>("Sound\\Poop" + i);
              PoopFX.Add(TmpFX);
            }
            for (int i = 1; i <= 5; i++)
            {
                TmpFX = Stuff.Content.Load<SoundEffect>("Sound\\Jump" + i);
                JumpFX.Add(TmpFX);
            }
        }
开发者ID:markustenghamn,项目名称:EggRoll,代码行数:27,代码来源:Sound.cs


示例10: PlayMusic

        /// <summary>
        /// Sets the background music to the sound with the given name.
        /// </summary>
        /// <param name="name">The name of the music to play.</param>
        public static void PlayMusic(string name)
        {
            currentSong = null;

            try
            {
                currentSong = content.Load<Song>(name);
            }
            catch (Exception e)
            {
            #if ZUNE
            //on the Zune we can go through the MediaLibrary to attempt
            //to find a matching song name. this functionality doesn't
            //exist on Windows or Xbox 360 at this time
            MediaLibrary ml = new MediaLibrary();
            foreach (Song song in ml.Songs)
                if (song.Name == name)
                    currentSong = song;
            #endif

                //if we didn't find the song, rethrow the exception
                if (currentSong == null)
                    throw e;
            }

            MediaPlayer.Play(currentSong);
        }
开发者ID:HeavyBomber,项目名称:HeavyBomber,代码行数:31,代码来源:SoundManager.cs


示例11: PlayMusic

        /// <summary>
        /// Play a song music
        /// </summary>
        /// <param name="music"></param>
        /// <param name="repeat"></param>
        private void PlayMusic(Song music, bool repeat)
        {
            StopMusic();

            MediaPlayer.IsRepeating = repeat;
            MediaPlayer.Play(music);
        }
开发者ID:shaoleibo,项目名称:YnaEngine,代码行数:12,代码来源:XnaAudioAdapter.cs


示例12: charger

        public void charger()
        {
            Lpas.Add(jeu.Content.Load<SoundEffect>("walk_1"));
            Lpas.Add(jeu.Content.Load<SoundEffect>("walk_2"));
            Lpas.Add(jeu.Content.Load<SoundEffect>("walk_3"));
            Lpas.Add(jeu.Content.Load<SoundEffect>("walk_4"));
            Lpas.Add(jeu.Content.Load<SoundEffect>("walk_5"));
            Lpas.Add(jeu.Content.Load<SoundEffect>("walk_6"));

            Lroule.Add(jeu.Content.Load<SoundEffect>("cart_1"));
            Lroule.Add(jeu.Content.Load<SoundEffect>("cart_2"));
            Lroule.Add(jeu.Content.Load<SoundEffect>("cart_3"));
            Lroule.Add(jeu.Content.Load<SoundEffect>("cart_4"));

            Lcri.Add(jeu.Content.Load<SoundEffect>("scream_01"));
            Lcri.Add(jeu.Content.Load<SoundEffect>("scream_02"));
            Lcri.Add(jeu.Content.Load<SoundEffect>("scream_03"));

            Ltoucher.Add(jeu.Content.Load<SoundEffect>("punch_1"));
            Ltoucher.Add(jeu.Content.Load<SoundEffect>("punch_2"));
            Ltoucher.Add(jeu.Content.Load<SoundEffect>("punch_3"));

            Splash = jeu.Content.Load<SoundEffect>("smash_dirty");
            theme = jeu.Content.Load<Song>("theme");

            SplashSound = jeu.Content.Load<Song>("music_intro");
            OverSound = jeu.Content.Load<SoundEffect>("game_over");
        }
开发者ID:jeansebbaklouti,项目名称:premieredemarque,代码行数:28,代码来源:Gestionsons.cs


示例13: Sound

        public Sound(SuperXbloxGame G)
            : base(G)
        {
            // G.Content.RootDirectory = "Content";
            //mTechno = G.Content.Load<Song>("Songs/tetris");
            RaveParty = G.Content.Load<Song>("Songs/RaveParty");
            TribalTrain = G.Content.Load<Song>("Songs/TribalTrain");
            TechnoRampage = G.Content.Load<Song>("Songs/TechnoRampage!!!");
            //mRock = G.Content.Load<Song>("Songs/tetris2");
            TheFunkyBandit = G.Content.Load<Song>("Songs/TheFunkyBandit");
            mIntro = G.Content.Load<Song>("Songs/RaveParty");
               // sniped=G.Content.Load<SoundEffect>("Sounds/sniped");
            //kaboom = G.Content.Load<SoundEffect>("Sounds/kaboom");
            //scratch = G.Content.Load<SoundEffect>("Sounds/scratch");
            //nextlevel = G.Content.Load<SoundEffect>("Sounds/nextlevel");
            //intro = G.Content.Load<SoundEffect>("Sounds/intro");
            //start = G.Content.Load<SoundEffect>("Sounds/start");
            //stop = G.Content.Load<SoundEffect>("Sounds/stop");
            //rotategrid = G.Content.Load<SoundEffect>("Sounds/rotategrid");
            //reward = G.Content.Load<SoundEffect>("Sounds/reward");
            //move = G.Content.Load<SoundEffect>("Sounds/move");
            //select = G.Content.Load<SoundEffect>("Sounds/select");

            //reload = G.Content.Load<SoundEffect>("Sounds/reload");
            MediaPlayer.Volume = 0.01f * OptionsMenuScreen.musicVolume;
            MediaPlayer.IsRepeating = true;
            //laser = G.Content.Load<SoundEffect>("Sounds/laser");
        }
开发者ID:hillgr,项目名称:SuperXblox360,代码行数:28,代码来源:Sound.cs


示例14: LoadContent

        public static void LoadContent(ContentManager content)
        {
            //Picture
            path = content.Load<Texture2D>("path");
            grass = content.Load<Texture2D>("grass");
            basicEnnemi = content.Load<Texture2D>("basicEnnemi");
            fastEnnemi = content.Load<Texture2D>("grass");
            armorEnnemi = content.Load<Texture2D>("grass");
            buttonTowerBasic = content.Load<Texture2D>("bouton basic tourelle");
            buttonTowerPower = content.Load<Texture2D>("bouton power tourelle");
            buttonTowerRange = content.Load<Texture2D>("bouton range tourelle");
            towerBasic = content.Load<Texture2D>("basicTower");
            towerPower = content.Load<Texture2D>("powerTower");
            towerRange = content.Load<Texture2D>("rangeTower");
            MainMenu = content.Load<Texture2D>("MainMenu");
            bullet = content.Load<Texture2D>("bullet");
            gold = content.Load<Texture2D>("gold");
            select = content.Load<Texture2D>("select");
            personnage = content.Load<Texture2D>("player");
            vieChateau = content.Load<Texture2D>("vie");
            chateau = content.Load<Texture2D>("chateau");
            Map = content.Load<Texture2D>("Map");

            //Font
            write = content.Load<SpriteFont>("Write");
            vie = content.Load<SpriteFont>("Write");
            gameOver = content.Load<SpriteFont>("GameOver");

            //Song
            ambiance = content.Load<Song>("01");
        }
开发者ID:TristanRsl,项目名称:Rizzle1,代码行数:31,代码来源:Ressources.cs


示例15: CustomInitialize

		void CustomInitialize()
		{
            this.Alternativas.Visible = false;
            Microsoft.Xna.Framework.Media.MediaPlayer.IsRepeating = true;
            song =
            FlatRedBallServices.Load<Song>(@"Content/intro", ContentManagerName);
            Microsoft.Xna.Framework.Media.MediaPlayer.Play(song);
		}
开发者ID:JdGXII,项目名称:EconoFight,代码行数:8,代码来源:MenuPrincipal.cs


示例16: PlaySong

 /// <summary>
 /// 播放音乐
 /// </summary>
 public void PlaySong(Song song)
 {
     if (MediaPlayer.State == MediaState.Stopped)
     {
         MediaPlayer.IsRepeating = true;
         MediaPlayer.Play(song);
     }
 }
开发者ID:HaKDMoDz,项目名称:LofiGameSDK,代码行数:11,代码来源:SoundManager.cs


示例17: Close

 public override void Close()
 {
     if (mSong != null)
     {
         mSong.Dispose();
         mSong = null;
     }
 }
开发者ID:weeeBox,项目名称:oldies-bc-craqua-xna,代码行数:8,代码来源:BcMusic.cs


示例18: lancer_musique

 public static void lancer_musique(ref bool lancer, Song musique)
 {
     if (!lancer)
     {
         MediaPlayer.Play(musique);
         lancer = true;
     }
 }
开发者ID:epiHoriZon,项目名称:HoriZon,代码行数:8,代码来源:Musique.cs


示例19: SoundManager

 public SoundManager(ContentManager content)
 {
     this.content = content;
       this.background = content.Load<Song>(@"sounds\background");
       this.hurt = content.Load<SoundEffect>(@"sounds\hurt");
       this.bounce = content.Load<SoundEffect>(@"sounds\bounce");
       this.collide = content.Load<SoundEffect>(@"sounds\collide");
 }
开发者ID:iliasashaikh,项目名称:BouncingBall,代码行数:8,代码来源:SoundManager.cs


示例20: LoadContent

 public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     Background.LoadContent(Content);
     Image.LoadConent(Content);
     this.backgroundMusic = Content.Load<Song>("sounds/backgroundMusic");
     MediaPlayer.Play(this.backgroundMusic);
     base.LoadContent(Content);
 }
开发者ID:TeamAmpere,项目名称:AdvancedC-Game,代码行数:8,代码来源:SplashScreen.cs



注:本文中的Microsoft.Xna.Framework.Media.Song类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Net.NetworkGamer类代码示例发布时间:2022-05-26
下一篇:
C# Media.MediaLibrary类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap