i start making custom action!
using UnityEngine;
using System.Collections;
namespace HutongGames.PlayMaker.Actions{
public class GUILabelWithScroll_C : GUIContentAction {
Vector2 scrollPosition;
public bool center = false;
public override void OnGUI(){
base.OnGUI();
/*int width = Screen.width/2;
int height = Screen.height/2;
if ( this.height != 0 ) height = this.height;
if ( this.width != 0 ) width = this.width;*/
//Debug.Log(screenRect.Value.x + " " + screenRect.Value.y + " " + screenRect.Value.height +" " + screenRect.Value.width);
if ( rect.height > Screen.height ) rect.height = Screen.height-20;
/*
if ( center )
{
rect.y *= screenRect.Value.y*2;
//rect.height *= Screen.height;
}
*/
GUI.BeginGroup(rect);
scrollPosition = GUILayout.BeginScrollView(scrollPosition, GUILayout.Width(rect.width), GUILayout.Height(rect.height));
GUILayout.Label (content);
GUILayout.EndScrollView ();
GUI.EndGroup();
/*
GUI.BeginScrollView(new Rect(100, 50, 400, 400), scrollPosition, new Rect(0, 0, 100, 200));
GUI.Label(new Rect(0, 0, 100, 100), content);
GUI.EndScrollView();
*/
}
}
}
It's a bit mess.. but is my first HACK!