mirror of
https://github.com/photonstorm/phaser
synced 2024-12-26 13:03:36 +00:00
b6bef1ded9
Added Key Capture to Keyboard Manager. Added rotation and angle wrapping. Optmized getBounds.
37 lines
579 B
JavaScript
37 lines
579 B
JavaScript
var Clamp = require('../math/Clamp');
|
|
|
|
// Alpha Component
|
|
|
|
// bitmask flag for GameObject.renderMask
|
|
var _FLAG = 2; // 0010
|
|
|
|
var Alpha = {
|
|
|
|
_alpha: 1,
|
|
|
|
alpha: {
|
|
|
|
get: function ()
|
|
{
|
|
return this._alpha;
|
|
},
|
|
|
|
set: function (value)
|
|
{
|
|
this._alpha = Clamp(value, 0, 1);
|
|
|
|
if (this._alpha === 0)
|
|
{
|
|
this.renderFlags &= ~_FLAG;
|
|
}
|
|
else
|
|
{
|
|
this.renderFlags |= _FLAG;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = Alpha;
|