FairyGUI.DisplayObject.TransformPoint C# (CSharp) Method

TransformPoint() public method

public TransformPoint ( Vector2 point, DisplayObject targetSpace ) : Vector2
point UnityEngine.Vector2
targetSpace DisplayObject null if to world space
return UnityEngine.Vector2
        public Vector2 TransformPoint(Vector2 point, DisplayObject targetSpace)
        {
            if (targetSpace == this)
                return point;

            point.y = -point.y;
            Vector3 v = this.cachedTransform.TransformPoint(point);
            if (targetSpace != null)
            {
                v = targetSpace.cachedTransform.InverseTransformPoint(v);
                v.y = -v.y;
            }
            return v;
        }

Usage Example

 static public int TransformPoint(IntPtr l)
 {
     try {
         FairyGUI.DisplayObject self = (FairyGUI.DisplayObject)checkSelf(l);
         UnityEngine.Vector2    a1;
         checkType(l, 2, out a1);
         FairyGUI.DisplayObject a2;
         checkType(l, 3, out a2);
         var ret = self.TransformPoint(a1, a2);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }