phaser/v3/src/gameobjects/components/Depth.js
2017-10-20 14:12:25 +01:00

34 lines
489 B
JavaScript

// Depth Component
var Depth = {
// "private" properties
_depth: 0,
depth: {
get: function ()
{
return this._depth;
},
set: function (value)
{
this.scene.sys.sortChildrenFlag = true;
this._depth = value;
}
},
setDepth: function (value)
{
if (value === undefined) { value = 0; }
this.depth = value;
return this;
}
};
module.exports = Depth;