I have a horizontal layout that has 3 children , i want to get the actual pixel screen position of the second child, the grid, i need this position because i am taking a screenshot of the second child, i can successfully get the width and height. see screenshot
What i tried, i need the opposite of RectTransformUtility.ScreenPointToLocalPointInRectangle
public Rect GetGridSize() {
Rect rect = gridTransform.rect;
//float scaleX = Screen.width / canvasScaler.referenceResolution.x;
bool landscape = Screen.width > Screen.height;
//float width = rect.width * scaleX;
CanvasScale = new Vector2((float) Screen.width / canvasScaler.referenceResolution.x, (float)Screen.height / canvasScaler.referenceResolution.y);
float scaleY = ((landscape) ? CanvasScale.y : CanvasScale.x);
float scaleX = ((landscape) ? CanvasScale.x : CanvasScale.y);
float height = Mathf.Round(rect.height * scaleY);
float layoutLeft = gridTransform.parent.GetComponent<RectTransform> ().offsetMin.x;
return new Rect((layoutLeft + gridTransform.offsetMin.x) * scaleX, Mathf.Round(25f * scaleY), height, height);
}
