Skip to content

Commit fa620e8

Browse files
committed
Split out the Depth setters to their own component.
1 parent a93a7e0 commit fa620e8

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Depth Component
2+
3+
var Depth = {
4+
5+
// "private" properties
6+
_depth: 0,
7+
8+
depth: {
9+
10+
get: function ()
11+
{
12+
return this._depth;
13+
},
14+
15+
set: function (value)
16+
{
17+
this.scene.sys.sortChildrenFlag = true;
18+
this._depth = value;
19+
}
20+
21+
},
22+
23+
setDepth: function (value)
24+
{
25+
if (value === undefined) { value = 0; }
26+
27+
this.depth = value;
28+
29+
return this;
30+
}
31+
32+
};
33+
34+
module.exports = Depth;

v3/src/gameobjects/components/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ module.exports = {
66
Animation: require('./Animation'),
77
BlendMode: require('./BlendMode'),
88
ComputedSize: require('./ComputedSize'),
9+
DataProxy: require('./DataProxy'),
10+
Depth: require('./Depth'),
911
Flip: require('./Flip'),
1012
GetBounds: require('./GetBounds'),
1113
Origin: require('./Origin'),

0 commit comments

Comments
 (0)