* Move the child in the group one step forward (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)
| 886 | * @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be moved |
| 887 | */ |
| 888 | moveUp(child) { |
| 889 | const childIndex = this.getChildIndex(child); |
| 890 | if (childIndex - 1 >= 0) { |
| 891 | // note : we use an inverted loop |
| 892 | this.swapChildren(child, this.getChildAt(childIndex - 1)); |
| 893 | // mark the container as dirty |
| 894 | this.isDirty = true; |
| 895 | } |
| 896 | } |
| 897 | |
| 898 | /** |
| 899 | * Move the child in the group one step backward (z depth). |
no test coverage detected