/// <summary> /// Load a sound from a named resource. /// </summary> /// <param name="resourceName">The name of the resource including the trailing ".wav"</param> /// <remarks>To embed a wav file, simple add it to the project, and change "Build Action" /// to "Embedded Resource".</remarks> /// <see cref="http://msdn.microsoft.com/en-us/library/ms950960.aspx"/> public static Audio FromResource(string resourceName) { Audio sound = new Audio(); sound.ResourceName = resourceName; return sound; }
/// <summary> /// Add the given sound to the animation so that it begins to play the given /// number of ticks after the animation starts. /// </summary> /// <param name="startTick">When should the sound begin to play?</param> /// <param name="sprite">The sprite that will appear</param> public void Add(long startTick, Audio sound) { this.AddControlBlock(new AnimateableControlBlock(startTick, sound)); }
/// <summary> /// Add the given sound to the animation so that it begins to play the given /// number of ticks after the animation starts. /// </summary> /// <param name="startTick">When should the sound begin to play?</param> /// <param name="sprite">The sprite that will appear</param> public void Add(long startTick, Audio sound) { this.AddControlBlock(new AnimateableControlBlock(startTick, sound)); }