mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
commit
c0aacdc39b
2 changed files with 12 additions and 1 deletions
|
@ -706,9 +706,10 @@ RenderedTarget.prototype.onGreenFlag = function () {
|
|||
|
||||
/**
|
||||
* Called when the project receives a "stop all"
|
||||
* Stop all sounds
|
||||
* Stop all sounds and clear graphic effects.
|
||||
*/
|
||||
RenderedTarget.prototype.onStopAll = function () {
|
||||
this.clearEffects();
|
||||
if (this.audioPlayer) {
|
||||
this.audioPlayer.stopAllSounds();
|
||||
this.audioPlayer.clearEffects();
|
||||
|
|
|
@ -11,3 +11,13 @@ test('clone effects', function (t) {
|
|||
t.ok(a.effects !== b.effects);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('#stopAll clears graphics effects', function (t) {
|
||||
var spr = new Sprite();
|
||||
var a = new RenderedTarget(spr, null);
|
||||
var effectName = 'brightness';
|
||||
a.setEffect(effectName, 100);
|
||||
a.onStopAll();
|
||||
t.equals(a.effects[effectName], 0);
|
||||
t.end();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue