public float native_width = 960;
public float native_height = 600;
void update ()
{
float rx = Screen.width / native_width;
float ry = Screen.height / native_height;
GUI.matrix = Matrix4x4.TRS (new Vector3(0, 0, 0), Quaternion.identity, new Vector3 (rx, ry, 1));
rect_inisde_mouse = new Rect(320, 552, 352, 43);
p_vector_mouse_pos = new Vector2(Input.mousePosition.x, 600- Input.mousePosition.y);//mouse postion adju with gui
if (rect_inisde_mouse.Contains (p_vector_mouse_pos))
{
p_bool_mouse_over = true;
}
}
it is working fine in editor when in windows build in different resolution the mouse x is not working at same point.I used Input.mousePosition to get the mouse position and rect = new Rect(320, 552, 352, 43); to get the position of the gui. when the mouse is over the rect (gui ) it should display the gui when mouse is not over the rect it should hide the gui but in different resolution the mouse x postion is not working properly in resolution it appears at different point.
is there a alernative way to show and hide gui when mouse is over the rect new Rect(320, 552, 352, 43);
when mouse is over the rect(gui) it should display the panel when mouse is not over the rect it should hide the panel.