Hello,
I’ve been looking for a while to rotate a GUI.Label.
After reading some previous questions, I managed to do rotation but the problem is that I can’t find how to do it without moving the label to another point on the screen.
here is the code I’m using :
var guipos:Vector3 = Camera.main.WorldToScreenPoint (transform.position);// get position to put the label
var pos : Vector3 = Vector3.zero;
var quat : Quaternion = Quaternion.identity; //rotation for matrix
quat.eulerAngles = Vector3(0, 0, 45); //rotate around Z axis
GUI.matrix = Matrix4x4.TRS(pos, quat, Vector3.one); // change the matrix
GUI.Label(Rect(guipos.x,guipos.y, 2000, 200), "blabla machin truc");
I guess the problem is that I have to change the origin for rotation somehow…
Any help would be appreciated .
Thanks.
EDIT:
If someone could provide a link to an explanation of how the GUI.matrix works it would be great !! If I can find the logic behind it I would probably find a way out