mirror of
https://github.com/photonstorm/phaser
synced 2024-12-19 17:44:45 +00:00
37 lines
560 B
JavaScript
37 lines
560 B
JavaScript
|
|
||
|
// Visible Component
|
||
|
|
||
|
var _visible = true;
|
||
|
|
||
|
// bitmask flag for GameObject.renderMask
|
||
|
var _FLAG = 1; // 0001
|
||
|
|
||
|
var Visible = {
|
||
|
|
||
|
visible: {
|
||
|
|
||
|
get: function ()
|
||
|
{
|
||
|
return _visible;
|
||
|
},
|
||
|
|
||
|
set: function (value)
|
||
|
{
|
||
|
if (value)
|
||
|
{
|
||
|
_visible = true;
|
||
|
this.renderFlags |= _FLAG;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
_visible = false;
|
||
|
this.renderFlags &= ~_FLAG;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
};
|
||
|
|
||
|
module.exports = Visible;
|