mirror of
https://github.com/photonstorm/phaser
synced 2024-12-25 04:23:30 +00:00
43 lines
690 B
JavaScript
43 lines
690 B
JavaScript
var BlendModes = require('../../renderer/BlendModes');
|
|
|
|
// BlendMode Component
|
|
|
|
var BlendMode = {
|
|
|
|
_blendMode: BlendModes.NORMAL,
|
|
|
|
blendMode: {
|
|
|
|
get: function ()
|
|
{
|
|
return this._blendMode;
|
|
},
|
|
|
|
set: function (value)
|
|
{
|
|
if (typeof value === 'string')
|
|
{
|
|
value = BlendModes[value];
|
|
}
|
|
|
|
value | 0;
|
|
|
|
if (value >= 0)
|
|
{
|
|
this._blendMode = value;
|
|
}
|
|
}
|
|
|
|
},
|
|
|
|
// const or string
|
|
setBlendMode: function (value)
|
|
{
|
|
this.blendMode = value;
|
|
|
|
return this;
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = BlendMode;
|