I’ve been reading up all day on Unity’s GUI documentation (I’m a total beginner with it), but I feel I just can’t get a solid grasp of it. I had a GUI.Label and tried to put it in a scrollview, but now it’s disappeared. Here is the script that I wrote largely based off the given documented examples.
#pragma strict
var myStyle : GUIStyle;
var scrollPosition : Vector2 = Vector2.zero;
function OnGUI ()
{
scrollPosition = GUI.BeginScrollView (Rect (10,300,100,100), scrollPosition, Rect (20, 600, 200, 200));
GUI.Label (Rect (20, 600, 200, 200), "Dots or Die is a simple game with a simple premise: Tap all the orange dots, and leave the other dots alone. If you do this, you will be handsomely rewarded. Just for touching an orange dot, you will receive ten points. A whole ten points! Here, let’s practice, shall we?
Brilliant! (assuming you hit the dot, otherwise I’m congratulating you for being disobedient and doing absolutely nothing). Now, hit this red dot.
So if you hit a red dot (or any dot that isn’t orange for that matter), you are now out of twenty hard-earned points. I know you’re thinking, that’s ridiculous, if I do my job, I only garner ten points, but then I make a mistake and twenty are deducted. Well, in short, yes… but think about this. Why are there five weekdays and only two days in the weekend? That’s an even worse ratio. Maybe this ostensibly simple game is actually a beautiful allegory acutely highlighting life’s injustices and iniquities? I’m not claiming it is, but there’s certainly room for discussion on it (and room for it on the description in the app store).That’s enough for now though, so I’ll let you play the game and decide. ", myStyle);
var vScrollbarValue : float;
vScrollbarValue = GUI. VerticalScrollbar (Rect (25, 25, 100, 30), vScrollbarValue, 1.0, 10.0, 0.0);
GUI.EndScrollView ();
}
Thank you for the help