@phaserjs/phaser
Version:
10 lines (9 loc) • 338 B
JavaScript
import { AddChild } from "./AddChild";
import { RemoveChildrenBetween } from "./RemoveChildrenBetween";
export function ReparentChildren(parent, newParent, beginIndex = 0, endIndex) {
const moved = RemoveChildrenBetween(parent, beginIndex, endIndex);
moved.forEach((child) => {
AddChild(newParent, child);
});
return moved;
}