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

Method setXY

packages/fairygui/src/core/GObject.ts:148–167  ·  view source on GitHub ↗

* Set position * 设置位置

(xv: number, yv: number)

Source from the content-addressed store, hash-verified

146 * 设置位置
147 */
148 public setXY(xv: number, yv: number): void {
149 if (this._x !== xv || this._y !== yv) {
150 const dx = xv - this._x;
151 const dy = yv - this._y;
152 this._x = xv;
153 this._y = yv;
154
155 this.handleXYChanged();
156
157 this.updateGear(1);
158
159 if (this._parent) {
160 this._parent.setBoundsChangedFlag();
161 if (this._group) {
162 this._group.setBoundsChangedFlag(true);
163 }
164 this.emit(FGUIEvents.XY_CHANGED);
165 }
166 }
167 }
168
169 public get xMin(): number {
170 return this._pivotAsAnchor ? this._x - this._width * this._pivotX : this._x;

Callers 15

xMethod · 0.95
yMethod · 0.95
xMinMethod · 0.95
yMinMethod · 0.95
centerMethod · 0.95
setSizeMethod · 0.95
setup_beforeAddMethod · 0.95
applyOnSizeChangedMethod · 0.80
showPopupMethod · 0.80
showTooltipsWinMethod · 0.80
applyValueMethod · 0.80
moveChildrenMethod · 0.80

Calls 4

handleXYChangedMethod · 0.95
updateGearMethod · 0.95
setBoundsChangedFlagMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected