MCPcopy Create free account
hub / github.com/esengine/esengine / replaceMe

Method replaceMe

packages/fairygui/src/widgets/GGraph.ts:220–239  ·  view source on GitHub ↗
(target: GObject)

Source from the content-addressed store, hash-verified

218 }
219
220 public replaceMe(target: GObject): void {
221 if (!this._parent) {
222 throw new Error('parent not set');
223 }
224
225 target.name = this.name;
226 target.alpha = this.alpha;
227 target.rotation = this.rotation;
228 target.visible = this.visible;
229 target.touchable = this.touchable;
230 target.grayed = this.grayed;
231 target.setXY(this.x, this.y);
232 target.setSize(this.width, this.height);
233
234 const index = this._parent.getChildIndex(this);
235 this._parent.addChildAt(target, index);
236 target.relations.copyFrom(this.relations);
237
238 this._parent.removeChild(this, true);
239 }
240
241 public addBeforeMe(target: GObject): void {
242 if (!this._parent) {

Callers

nothing calls this directly

Calls 6

setXYMethod · 0.80
getChildIndexMethod · 0.80
setSizeMethod · 0.45
addChildAtMethod · 0.45
copyFromMethod · 0.45
removeChildMethod · 0.45

Tested by

no test coverage detected