Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Wrong Buttons Hotspot

Discussion in 'Immediate Mode GUI (IMGUI)' started by Luca91, Apr 30, 2013.

  1. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    Hello,
    I've already posted this issue on Unity Answers, but nobody helped me, so I'm posting it here too.
    I'm experiencing a very weird issue. Since I used this code :
    Code (csharp):
    1.  
    2. scale.x = Screen.width/1280.0f; // calculate hor scale
    3. scale.y = Screen.height/854.0f; // calculate vert scale
    4. scale.z = 1;
    5. GUI.matrix =  Matrix4x4.TRS(Vector3.zero, Quaternion.identity, scale);
    6.  
    to avoid that the menu would be corrupted with different screen resolutions, I've the buttons hotspot out of sync...

    Here is a picture of the issue :


    As you can see, the mouse is not on the button, but the button looks like to be focused !

    Any help is really appreciated !
     
  2. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410