Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by AlfredDuler · Aug 01, 2013 at 04:34 PM · buttonwindowfront

Button in front of GUI Window

Hello everyone,

Basically, I have a scrollview of windows, and I'd like to have a main button in front of it.

But I'm unable to achieve this. I tried with GUI.BringWindowToBack, GUI.depth and even try to create the button from another script but nothing seems to work.

Does anyone ever achieve to do this?

Thanks in advance

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image roojerry · Aug 01, 2013 at 04:48 PM 0
Share

Windows float above normal GUI controls

from the script reference

are you wanting a button inside of your window?

avatar image AlfredDuler · Aug 01, 2013 at 04:50 PM 0
Share

Not really, I need a button in front of all my windows

avatar image roojerry · Aug 01, 2013 at 05:08 PM 0
Share

As I quoted above, I dont believe you can get a normal GUI Button in front of a window without it being placed inside the window.

avatar image AlfredDuler · Aug 01, 2013 at 05:12 PM 0
Share

Yeah that what I found around the net too. But it seems so obvious that many people have tried to do it, that's why I was asking if nobody have found a hack or an alternative solution

2 Replies

· Add your reply
  • Sort: 
avatar image
-1

Answer by tw1st3d · Aug 01, 2013 at 04:37 PM

 using UnityEngine;
 using System.Collections;
 
 public class Menu : MonoBehavior
 {
     void OnGUI()
     {
         GUI.Box(); 
         // Make a GUI Box, 
         // No values for time saving
         GUI.Box(); 
         // Let's make another one
         
         GUI.Button();
         // NOW create the button
     }
 }

create the button after everything else

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlfredDuler · Aug 01, 2013 at 04:42 PM 0
Share

Thanks for the reply but i'm talking about GUI.Window, not Box.

avatar image tw1st3d · Aug 01, 2013 at 04:43 PM 0
Share

It should work exactly the same, however if I'm mistaken, sorry.

avatar image AlfredDuler · Aug 01, 2013 at 04:49 PM 0
Share

Not really, GUI.Window are created in a weird way which make the placement of the button at the end useless.

avatar image
0

Answer by Seizure · Aug 01, 2013 at 04:38 PM

Yes I am able to do it, much like you did, with GUI.bringWindowToBack and GUI.Depth. One of the things I am probably doing different though is that my button is in a seperate script from my window. Try setting the window to a lower GUI.Depth and sending it to the back in a seperate script.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlfredDuler · Aug 01, 2013 at 04:46 PM 0
Share

First Script:

  GUI.depth = -20;
     
   scrollPosition = GUI.BeginScrollView (rScrollFrame, scrollPosition, rList, false, false);
         
         for ( var k : int = 0; k < numRows; k++)
         {
             
             GUI.Window (k,  Rect(0,Screen.height/10-scrollPosition.y + (k*200),Screen.width-30,200), GUI.WindowFunction (testW), ""); 
         }
     
   GUI.EndScrollView();

second script:

     GUI.depth = 20;
 if( GUI.Button(Rect(0,0, Screen.width, Screen.height/10), ""))
 {
 
     //nothing
 }    

But not working at all!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do i cal second question in a window? 1 Answer

Easy way to make buttons in-accessible when under a pop-up window? 1 Answer

Hiding/Showing window on button 3 Answers

How to display data from array,arraylist while clicking the button? 1 Answer

GUI Buttons unresponsive in new window 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges