Skip to content

Instantly share code, notes, and snippets.

@HiromichiYamada
Last active December 14, 2015 19:59
Show Gist options
  • Save HiromichiYamada/5140446 to your computer and use it in GitHub Desktop.
Save HiromichiYamada/5140446 to your computer and use it in GitHub Desktop.
// ref. http://docs.unity3d.com/Documentation/ScriptReference/GUI.BeginScrollView.html
var posScroll : Vector2;
function Start() {
posScroll = Vector2.zero;
}
function OnGUI() {
var rectScroller : Rect = Rect( 0, 0, 320, 400 );
var rectScrollee : Rect = Rect( 0, 0, 320, 1000 );
var alwaysShowHorizontal : boolean = false;
var alwaysShowVertical : boolean = true;
posScroll = GUI.BeginScrollView(rectScroller, posScroll, rectScrollee, alwaysShowHorizontal, alwaysShowVertical);
// contents.
GUI.Box( rectScrollee, "スクロールの中身" );
GUI.EndScrollView();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment