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