MusicTests PlayDifferentMusicOnClick Method Delta Engine Documentation

Namespace: DeltaEngine.Multimedia.Tests
Assembly: DeltaEngine.Multimedia.Tests (in DeltaEngine.Multimedia.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void PlayDifferentMusicOnClick()
Examples

[Test, Ignore]
public void PlayDifferentMusicOnClick()
{
    new FontText(Font.Default, "Click to Play", Rectangle.One);
    var music = ContentLoader.Load<Music>("DefaultMusic");
    var music2 = ContentLoader.Load<Music>("DefaultMusicBackwards");
    var musics = new[] { music, music2 };
    int index = 0;
    new Command(() => musics[(index++) % 2].Play(1f)).Add(new MouseButtonTrigger());
}
See Also