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

Method globalToLocal

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

* Convert global point to local * 全局坐标转本地坐标

(ax: number = 0, ay: number = 0, outPoint?: Point)

Source from the content-addressed store, hash-verified

802 * 全局坐标转本地坐标
803 */
804 public globalToLocal(ax: number = 0, ay: number = 0, outPoint?: Point): Point {
805 outPoint = outPoint || new Point();
806 outPoint.x = ax;
807 outPoint.y = ay;
808
809 if (this._displayObject) {
810 this._displayObject.globalToLocal(outPoint, outPoint);
811 }
812
813 if (this._pivotAsAnchor) {
814 outPoint.x -= this._pivotX * this._width;
815 outPoint.y -= this._pivotY * this._height;
816 }
817
818 return outPoint;
819 }
820
821 /**
822 * Convert local rect to global

Callers 10

globalToLocalRectMethod · 0.95
hitTestFunction · 0.80
hitTestInChildrenMethod · 0.80
startDragMethod · 0.80
handleGripTouchBeginMethod · 0.80
handleGripTouchMoveMethod · 0.80
handleBarTouchBeginMethod · 0.80
layoutModalWaitPaneMethod · 0.80
onMouseDownMethod · 0.80
onMouseMoveMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected