Rotating a GUIText

Hi,

How do you rotate a GUIText on the screen, which updates it’s value based on a variable…
without having to go into onGUI function , ???

Is there a way ?

I don’t think there is a way to rotate a GUITexture gradually like this. You might find it easier to have an object in the scene parented to the camera and rotate it using transform.localRotation. Another approach is to draw the texture using GUI.DrawTexture but also use GUIUtility.RotateAroundPivot to perform the rotation.

Thanks for the reply, however i wanted to know about Rotating a GUIText, not a GUITexture , rotating GUITexture is not a problem , but i can’t find a way thus far, to rotate GUIText, without having to look into onGUI function,

Sorry about the mistake there (actually I would have expected GUIText and GUITexture to have the same behaviour anyway).

You can use GUI.Label to add create text in the OnGUI function, and the RotateAroundPivot call should work the same for this as for a texture.

Alright, i guess you can only do it with the onGUI function, which i know is hard on processing power , that’s why i didn’t want to use it !

Alright, so i got the function all together and rotated , but how can you update the GUI Label within the update function to display numbers ,

update doesn’t seem to want to deal with GUI Label ?!

You can only call the GUI functions from OnGUI. You should set variables with the appropriate values in Update and then pick them up in OnGUI for display.