leonida
1
Hi,
there’s a way for see the gui text mirrored?
i use this code for rotate text,but i can’t mirror it…
private var rotAngle : float = 0;
private var pivotPoint : Vector2;
function OnGUI () {
pivotPoint = Vector2(Screen.width/2,Screen.height/2);
GUIUtility.RotateAroundPivot (rotAngle, pivotPoint);
if(GUI.Button(Rect(Screen.width/2-25, Screen.height/2-25, 50, 50),"Rotate"))
rotAngle += 10;
}
Wolfram
2
Try GUIUtility.ScaleAroundPivot with -1 for x. If that doesn’t work for negative values, you’ll have to modify GUI.matrix directly.
here’s the code that i’ve used
var text="tryyyyyyy";
var w=200;
var h=200;
private var scale : Vector2 = Vector2(1,1);
private var pivotPoint : Vector2;
private var onetime = true;
function OnGUI () {
pivotPoint = Vector2(Screen.width/2,Screen.height/2);
GUIUtility.ScaleAroundPivot (scale, pivotPoint);
GUIUtility.RotateAroundPivot (rotAngle, pivotPoint);
GUI.Box(Rect(Screen.width/2, Screen.height/2, w, h),text);
if (onetime){scale += Vector2(0,-2);onetime=false;}
}