* Move the child in the group one step backward (z depth). * @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be moved
(child)
| 900 | * @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be moved |
| 901 | */ |
| 902 | moveDown(child) { |
| 903 | const childIndex = this.getChildIndex(child); |
| 904 | if (childIndex >= 0 && childIndex + 1 < this.getChildren().length) { |
| 905 | // note : we use an inverted loop |
| 906 | this.swapChildren(child, this.getChildAt(childIndex + 1)); |
| 907 | // mark the container as dirty |
| 908 | this.isDirty = true; |
| 909 | } |
| 910 | } |
| 911 | |
| 912 | /** |
| 913 | * Move the specified child to the top(z depth). |
no test coverage detected