2016-10-03 10:16:43 -04:00
|
|
|
var test = require('tap').test;
|
2016-10-26 11:19:43 -04:00
|
|
|
var RenderedTarget = require('../../src/sprites/rendered-target');
|
2016-10-03 10:16:43 -04:00
|
|
|
var Sprite = require('../../src/sprites/sprite');
|
|
|
|
|
|
|
|
test('clone effects', function (t) {
|
|
|
|
// Create two clones and ensure they have different graphic effect objects.
|
|
|
|
// Regression test for Github issue #224
|
|
|
|
var spr = new Sprite();
|
2016-10-26 11:19:43 -04:00
|
|
|
var a = new RenderedTarget(spr, null);
|
|
|
|
var b = new RenderedTarget(spr, null);
|
2016-10-03 10:16:43 -04:00
|
|
|
t.ok(a.effects !== b.effects);
|
|
|
|
t.end();
|
|
|
|
});
|
2017-03-06 16:15:04 -05:00
|
|
|
|
|
|
|
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();
|
|
|
|
});
|