forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBringToTop.js
More file actions
65 lines (49 loc) · 1.27 KB
/
Copy pathBringToTop.js
File metadata and controls
65 lines (49 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Phaser.Component.BringToTop = function () {};
/**
* Brings the Sprite to the top of the display list it is a child of. Sprites that are members of a Phaser.Group are only
* bought to the top of that Group, not the entire display list.
*
* @method Phaser.Sprite#bringToTop
* @memberof Phaser.Sprite
* @return (Phaser.Sprite) This instance.
*/
Phaser.Component.BringToTop.prototype.bringToTop = function() {
if (this.parent)
{
this.parent.bringToTop(this);
}
return this;
};
Phaser.Component.BringToTop.prototype.sendToBack = function() {
if (this.parent)
{
this.parent.sendToBack(this);
}
return this;
};
/**
* Moves the given child up one place in this group unless it's already at the top.
*
* @method Phaser.Group#moveUp
* @return {any} The child that was moved.
*/
Phaser.Component.BringToTop.prototype.moveUp = function () {
if (this.parent)
{
this.parent.moveUp(this);
}
return this;
};
/**
* Moves the given child down one place in this group unless it's already at the bottom.
*
* @method Phaser.Group#moveDown
* @return {any} The child that was moved.
*/
Phaser.Component.BringToTop.prototype.moveDown = function () {
if (this.parent)
{
this.parent.moveDown(this);
}
return this;
};