- Home /
Question by
Carnifex12 · Dec 01, 2014 at 10:26 PM ·
scrollboxside-scrolling
Scroll Bar on a GUI Box?
Hello, I'm looking for a way to add a scroll bar onto a box in my GUI.
Here is my box:
function OnGUI () {
GUI.Box (Rect ((Screen.width/12),(Screen.height/12),(Screen.width - (Screen.width/6)),(Screen.height - (Screen.height/6))), story);
}
The box appears where I want it just fine, but now I want to add a scroll bar to the right side of the box. This is because I will sometimes have large amounts of text within the box at one time. I want to have the scroll-able area reach just as far down as my string is (story). How can this be done?
Also if there is a way to make it so the scroll bar isn't visable when there isn't enough text in the box to require the scrollbar to see it all, I'd love to hear of it. Thanks!
Comment
Your answer
Follow this Question
Related Questions
GUI Scroll View 1 Answer
Buttons in UI Scroll Rect 2 Answers
Scrollrect bad performance with Unity 4.6 on Android 2 Answers
Lagging in 2D infinite BG scrolling 0 Answers