Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlxSoundGroup: add pause() and resume() #2043

Merged
merged 2 commits into from
Feb 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion flixel/system/FlxSoundGroup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,26 @@ class FlxSoundGroup
return false;
}

/**
* Call this function to pause all sounds in this group.
* @since 4.3.0
*/
public function pause():Void
{
for (sound in sounds)
sound.pause();
}

/**
* Unpauses all sounds in this group. Only works on sounds that have been paused.
* @since 4.3.0
*/
public function resume():Void
{
for (sound in sounds)
sound.resume();
}

private function set_volume(volume:Float):Float
{
this.volume = volume;
Expand All @@ -64,4 +84,4 @@ class FlxSoundGroup
}
return volume;
}
}
}