Search Unity

Trouble creating a specific type of Pop up Window

Discussion in 'Scripting' started by Sicklilmonky, Dec 2, 2011.

  1. Sicklilmonky

    Sicklilmonky

    Joined:
    Feb 15, 2011
    Posts:
    30
    OK I've got a basic window that opens to roughly the middle of the screen, whether it will still be in the middle of the screen when I out put this to the stand alone player is another question??

    1. Now how do I add another button for purchase? (needs to include a web link that will open a web browser)
    2. How do I add an image of my product over on the left?
    3. How do I add some descriptive text to the right of where I want my product photo?
    4. The other thing I'm trying to figure out is how to make it so my player or background behind the pop up window freezes until the window is closed?


    I should also mention that my target output is fro the standalone player and that I am using the FREE version of unity 3D.

    Take a look at my GUI layout window sketch please go here to see it: http://mdkgraphics.blogspot.com/
    Here is my code so far, please keep in mind that I'm am not a coder and totally not really getting how the whole gui thing works.




    HTML:
    var windowRect : Rect = Rect (20, 20, 120, 50);
    
    var doWindow0 : boolean = false;
    
    
    
    function OnGUI () {
    
    
    
    
    
    // Make sure we only call GUI.Window if doWindow0 is true.
    
    if (doWindow0)
    
    GUI.Window (0, Rect (350,250,800,500), DoMyWindow, "Suicide of T-Bear T-Shirt.");
    
    }
    
    
    
    // Make the contents of the window
    
    function DoMyWindow (windowID : int) {
    
    
    
    //I need to place a photo of the product here somehow?
    
    
    
    
    
    
    
    
    
    
    
    //I'm trying to place a paragraph of text here but I seem to be limited to one line
    
    GUI.Box(Rect(400,100,360,300), "The attempted suicide of T");
    
    
    
    
    
    
    
    if (GUI.Button( Rect(690,450.5,75,25),"Buy It")) {
    
    Application.OpenURL("http://www.zazzle.com/t_bear_suicide_t_shirt-235455214631112735");
    
    }
    
    
    
    if (GUI.Button (Rect (680,20,100,20), "Close"))
    
    doWindow0 = false;
    
    }
    
    
    
    function OnMouseDown()
    
    {
    
    doWindow0 = true;