phaser/src/gameobjects/components/Visible.js

43 lines
672 B
JavaScript
Raw Normal View History

// Visible Component
// bitmask flag for GameObject.renderMask
var _FLAG = 1; // 0001
var Visible = {
_visible: true,
visible: {
get: function ()
{
return this._visible;
},
set: function (value)
{
if (value)
{
this._visible = true;
this.renderFlags |= _FLAG;
}
else
{
this._visible = false;
this.renderFlags &= ~_FLAG;
}
}
2017-06-27 21:44:16 +00:00
},
setVisible: function (value)
{
this.visible = value;
2017-06-27 21:44:16 +00:00
return this;
}
};
module.exports = Visible;