Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Fuzzyursa · May 19, 2014 at 05:29 PM · scrollingscrollbarscroll view

Scrollview not showing scroll bar and not scrolling

I am having a problem with the Scrollview. i am not getting the scroll bar to show up and it is not scroll.

 public Vector2 scrollPostion = Vector2.zero;

 ...
 
 void OnGUI()
         {
             if (listdownloaded) 
             {
                 StopCoroutine("getlevels");
                 GUI.Window(1, new Rect(Screen.width*0.1f,Screen.height*0.1f, Screen.width*0.8f, Screen.height*0.8f), customlevelbuttonlist, "Custom Levels");
             }
             else if(...
         }
 
     void customlevelbuttonlist(int windowID)
     {
         float count=0;
         scrollPostion=GUI.BeginScrollView(new Rect(Screen.width*0.05f, Screen.height*0.05f, Screen.width*0.75f, Screen.height*0.7f), scrollPostion, new Rect(0,0, Screen.width*0.7f, Screen.height*0.65f));
         foreach(CustomLevel level in CustomLevels)
         {
             if(GUI.Button(new Rect(0, buttonheight*count, Screen.width*0.7f, 45), level.Name))
             {
                 Commons.levelLocation=CustomLevels[(int)count].location;
                 updatepercent();
                 UpDateAchievements();
                 Application.LoadLevel(gotoSceneIndex);
                 Debug.Log(CustomLevels[(int)count].location.ToString());
                 Debug.Log(SceneIndex);
             }
             count++;
         }
         GUI.EndScrollView();
     }

I am not sure if i am doing something small wrong or what. this is the first time i have tried to work with scrollviews, so any help i can get would be great.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by zharik86 · May 20, 2014 at 07:05 PM

About GUI Scroll see my pregoing response. In your case in line 18

  scrollPostion=GUI.BeginScrollView(new Rect(Screen.width*0.05f, Screen.height*0.05f, Screen.width*0.75f, Screen.height*0.7f), scrollPostion, new Rect(0,0, Screen.width*0.7f, Screen.height*0.65f));

you set dimension on screen your scroll, how Screen.width*0.75f, Screen.height*0.7f. But dimension self scroll is Screen.width*0.7f, Screen.height*0.65f. Of couse, you don't see your scroll. Simple change your dimension scroll, for example, little more your screen dimension of scroll:

  scrollPostion=GUI.BeginScrollView(new Rect(Screen.width*0.05f, Screen.height*0.05f, Screen.width*0.75f, Screen.height*0.7f), scrollPostion, new Rect(0,0, Screen.width*0.8f, Screen.height*0.75f));

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 No_Username_Found · Mar 13, 2015 at 04:07 AM 0
Share

To clarify the above comment:

When you declare a BeginScrollView() you give it two Rect(). The second Rect() needs to be slightly larger in order for the scroll bars to render properly.

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

21 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 avatar image avatar image avatar image avatar image

Related Questions

Changing the scale of the scroll view 1 Answer

I am still able to scroll even though scroll type is clamped? 0 Answers

Smooth scrollbar movement on display release 0 Answers

How do i move the vertical scrollbar thumb using left-mouse click and dragging it ? 2 Answers

How can I create a Multi line Input Field with Scrollbar? 0 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