ok why is it inverted?
when I’m placing GUI elements top left is X0 Y0
when moving with my mouse position bottom left is X0 Y0
it gives me loads of headache I can go with either one preferable top left but
for doing correct stuff sometimes in code I have to
YPos = -10-IYPos-(ItemCount*20)+((Input.Mouseposition.y - Screen.height) * -1); // it's for moving buttons around GUI
and sometimes not I’d prefer that’s always same
I was trying with project settings inputs but no invert seems to fix it
example:
void OnGUI() {
Vector2 gPos = new Vector2(10, 20);
GUI.BeginGroup(new Rect(0, 0, Screen.width, Screen.height));
Vector2 convertedGUIPos = GUIUtility.GUIToScreenPoint(gPos);
Debug.Log("GUI: " + gPos + " Screen: " + convertedGUIPos);
GUI.Label(new Rect(0,0,100,20),Input.mousePosition.x.ToString());
GUI.Label(new Rect(0,20,100,20),Input.mousePosition.y.ToString());
GUI.EndGroup();
}
labels are at top left while saying that 0,0 is bottom left
even if this page says it does it reverseGUIUtility.GUIToScreenPoint
also it doesn’t matter for
Vector2 gPos = new Vector2(10, 20);
where it is before or after begin group