Skip to main content

Posts

Showing posts from July, 2013

how to scroll in scrollview without scrollbar in unity iphone

Just few lines of code..

varskin : GUISkin;
varscrollPosition : Vector2; vartouchpos : Vector2;
varlongString ="This is a long-ish string";

functionUpdate () {
for(vartouch : TouchinInput.touches)  { if(touch.phase == TouchPhase.Moved)         {                  scrollPosition.y += touch.deltaPosition.y;        // dragging         } } }
functionOnGUI() {
GUILayout.BeginArea (Rect(60,0,500,1050)); GUI.skin = skin;     scrollPosition = GUILayout.BeginScrollView (scrollPosition, GUILayout.Width (500),      
GUILayout.Height (1000));
GUILayout.Label (longString);
GUILayout.EndScrollView (); GUILayout.EndArea ();
}

In the GUISkin just remove the images of Vertical slidder (you can find that in normal option ) same to Vertical slidder Thumb.
If there is any Question ask through comments..
Thanks  Sushanta