-
|
Suppose I have a component At first, I thought this would be as simple as Do you guys have any suggestions for how to achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
Edit: this was solved by #906 and Good idea! This should be pretty easy to implement. Right now you would have to do something like this: v.remove(x);
w.changePriorityWithoutResorting(x.priority);
// wait for next tick
x.shouldRemove = false;
w.addChild(x);
v.add(w);After #906 you could do this instead: w.changePriorityWithoutResorting(x.priority);
v.add(w);
x.changeParent(w);So with this suggestion it would be something like this? v.replaceChild(x, w, inheritPriority: true, inheritPosition: true ...);
w.add(x); |
Beta Was this translation helpful? Give feedback.
Edit: this was solved by #906 and
component.changeParentGood idea! This should be pretty easy to implement.
With
replaceChildI would expectWto fully takeXplace in the tree though, and not wrapX, but maybe that is what you meant with theW(X)notation, thatXis added toWthere already?I'm guessing we need quite a lot of optional parameters for the method too, since for a
PositionComponentyou might want it to take theposition,size,scaleorangleof the component that it replaces too.Right now you would have to do something like this:
After #906 you…