Search Unity

Different GUI Group positions

Discussion in 'Immediate Mode GUI (IMGUI)' started by Boingbloed, Feb 11, 2014.

  1. Boingbloed

    Boingbloed

    Joined:
    Oct 17, 2012
    Posts:
    6
    Hey, hope you are all well. I am a new to Unity, I am just posting this because I couldn't find anything on the problem:

    I have a very simple GUI group for an interactive book I am trying to do (script below). If I open this in chrome it seems to be in a different position than in explorer, if I build it a pc.exe file it has yet another position.

    Is there some obvious mistake I am making?

    Thanks Christian


    // _003010EngBookTitle

    var model : GameObject;
    var track : AudioClip;
    var mySkin : GUISkin; // Assign the skin to be mySkin.

    function OnGUI () {
    GUI.skin = mySkin;

    GUI.BeginGroup (Rect (Screen.width / 4.1 - 100, Screen.height / 2.5 - 50, 1000, 600)); // Make a group on the center of the screen- First No Pos y/Second No in X

    //value 2.6 left for Pc exe files/
    //2.5 up and down

    //beginning of group of buttons;

    if (GUI.Button (Rect (0,550,30,30), "<")) //create button and word
    Application.LoadLevel ("003000EngBookMenue"); //load 003000EngBookMenue when button is clicked

    if (GUI.Button (Rect (470,550,30,30), ">")) //create button and word
    Application.LoadLevel ("003020EngBookContents"); //load 003020EngBookContents when button is clicked

    if (GUI.Button (Rect (220,550,70,25), "Audio")) //Make Audio button
    { audio.loop = false; audio.PlayOneShot(track);}


    // end of group buttons2

    GUI.EndGroup (); // End the group we started above. This is very important to remember!

    }