Unity: Rotating GUI text




Just a quick one: Unity/iPhone developer Col000r throws a cool code snippet to do rotated GUI text:

// This comes from Col000r's site: 
//http://col000r.blogspot.com/2009/08/unity-rotated-gui-text.html
function OnGUI () {
   var pos : Vector3 = new Vector3(100, 200, 0); //position for matrix
   var quat : Quaternion = Quaternion.identity; //rotation for matrix
   quat.eulerAngles = Vector3(0, 0, 90); //set the rotation to something - rotate around z!
   GUI.matrix = Matrix4x4.TRS(pos, quat, Vector3.one); //Apply the matrix 
   GUI.Label(Rect(0, 0, 200, 20), "Some Text"); //notice how the rect starts at 0/0 and the matrix handles the position!
}


I've not tried it, but it's pretty cool. Nice work, Col000r. Col000r's got a lot of great tips for programming, sound, modelling and animating. Definitely a blog worth bookmarking/subscribing to.





Feedback - 3 responses

Displayed newest to oldest. Leave a comment.
affordable health insurance ga wrote:   
This specific posting appeared to be very well prepared and it also contains a large amount of useful points. I actually liked your qualified way with words that article. Thanks a lot you get the idea quite simple that i can have an understanding of.
affordable health insurance ga
health insurance gap plans wrote:   
You will be making a terrific point. Got a bit of great facts the following. I do believe whenever more and more people pondered it this way, that they had employ a improved period comprehending the situation. The check out is obviously something Identity want to see really. Thanks for your facts, health insurance gap plans
south group insurance services sc wrote:   
Nice post. Many thanks for using the time to upload this information extremely helpful!I’m continue to watching for quite a few interesting thoughts through your part within your next article thanks.
south group insurance services sc

Leave a comment

Name:
Website:
Comment:

Email:
Captcha:
Identify the image of a Martini glass:

           

           

 

This site is mostly about

Video Game Design

User Interface Design

Creative & fun stuff

 

Your Host

I'm Hanford Lemoore. My parking skills are unparalleled.

I make things. From consumer electronics, to video games, to theme park attractions. Perhaps I can make things for you! Check out my portfolio.

When I'm not making things for other people, I'm usually experimenting.

 

Contact

Follow me on Twitter.

Message me on Facebook.

Email me using my contact form.

 

RSS 2.0

 

maquettegame.com

tikiroom.com

junkyardclubhouse.com

monolux.com

 

   


Copyright 2012 Hanford Lemoore | Blog | About | Portfolio | Contact
Powered by Olark