新家地址:
http://www.jiezhang.me
iOS Developer
Sunday, December 25, 2011
Tuesday, May 3, 2011
Unity3d code clip : auto height lable and mouse touchable scrolling
var wasScrolling : boolean = false;
var scrollPosition : Vector2;
var longString = "This is a long-ish string This is an sized label. This is an sized label. This is an sized label. This is an sized label. This is an sized label. ";
function OnGUI () {
var rectForDescription : Rect = Rect(100,100,100,100);
GUILayout.BeginArea(rectForDescription);
scrollPosition = GUILayout.BeginScrollView (scrollPosition, GUILayout.Width (100), GUILayout.Height (100));
GUILayout.Label (longString);
GUILayout.EndScrollView ();
GUILayout.EndArea();
if( Event.current.type==EventType.MouseDown && rectForDescription.Contains(Event.current.mousePosition) ) {
wasScrolling = true;
print("down");
}
if( Event.current.type==EventType.MouseDrag && wasScrolling==true ) {
print(Event.current.delta.y);
scrollPosition.y+=Event.current.delta.y;
}
if( Event.current.type==EventType.MouseUp && wasScrolling == true) {
print("end scrolling");
wasScrolling = false;
}
}
Wednesday, March 9, 2011
a temporary solution for PEAR Install with PHP5.3
I met a Bug of PHP(still doesn't fixed yet) about halt_compiler function which caused installing PEAR fail.
This command doesn't work in PHP5.3
To fix(for the time being) it, use this command:
php go-pear.phar
This command doesn't work in PHP5.3
To fix(for the time being) it, use this command:
php -ddetect_unicode=0 go-pear.phar
Subscribe to:
Posts (Atom)