- Home /
Question by
DaiMangouDev · Sep 04, 2015 at 10:28 PM ·
c#guiscrollview
Why cant I scroll Horizontally in GUI.BeginScrollArea when i set GUIStyle params to null ?
Here is an example
I want my scroll area without any scrollbars . Unity gives us this option.
However when I implement it . I can only scroll virtically with my trackpad or graphics tablet ... but I cant scroll horizontally here :
public Vector2 ScrollView;
void OnGUI()
{
ScrollView = GUI.BeginScrollView(new Rect(0, 0,300,100), ScrollView, new Rect(0, 0, 900,100), GUIStyle.none, GUIStyle.none);
//I can still scroll birtically
//but
// I cant scroll Horizontally here
GUI.EndScrollView();
}
Comment
Answer by kbumpious · Sep 04, 2015 at 10:55 PM
I usually use the inspector for creating GUI elements. Could this be your issue?
GameObject -> Scrol Rect (Script) -> Checking vertical but unchecking horizontal allows you to only scroll vertically. Checking both allows scrolling in both directions.
screen-shot-2015-09-04-at-65247-pm.png
(27.7 kB)
I am working in OnGUI() I'm not using UnityEngine.UI