Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by user-4156 (google) · Aug 16, 2010 at 07:52 AM · guirotateinterfaceelementuser

Individually rotate GUI Elements?

How would I go about rotating an individual GUI Element separate to the rest of the GUI, meaning rotate one thing but not others, is this even possible?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by Eric5h5 · Aug 16, 2010 at 02:48 PM

GUI functions can be rotated using GUI.matrix. GUIText and GUITexture elements can't be rotated. When using GUI.matrix in OnGUI, you should reset the matrix after the element you want rotated.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
5

Answer by Alexej Grohe · Oct 18, 2010 at 06:26 PM

This is not right. You CAN rotate any GUI element individually. Its very simple, you rotate the whole GUI, draw your specific element and reverse the rotation. Look at this:

GUIUtility.RotateAroundPivot(clockNeedlRotation, Vector2(clockNeedlOffset.x, clockNeedlOffset.y+clockNeedl.height));
DrawImage(clockNeedlOffset, clockNeedl);
GUIUtility.RotateAroundPivot(-clockNeedlRotation, Vector2(clockNeedlOffset.x, clockNeedlOffset.y+clockNeedl.height));

Cheers,

Alexej

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bampf · Oct 18, 2010 at 06:43 PM 2
Share

True only if the questioner is referring to UnityGUI. But that's not clear- there are also GUIText and GUITexture objects, which are not rendered by OnGUI. Eric's answer takes this into account (though he doesn't have code like you do.)

avatar image Jesus_Freak · Dec 22, 2010 at 01:29 PM 0
Share

where did you find that script? or at least, what variables do you need to make, and what do they represent?

avatar image YoungDeveloper · Jul 18, 2014 at 07:52 AM 0
Share

Or ins$$anonymous$$d of removing the clock rotation reset the matrix.

 GUI.matrix = $$anonymous$$atrix4x4.identity;

avatar image
1

Answer by Jean-Fabre · Jan 26, 2011 at 04:58 AM

Hi,

There is a working script in the following question:

http://answers.unity3d.com/questions/3561/how-to-rotate-gui-textures

Bye,

Jean

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
-2

Answer by qJake · Aug 16, 2010 at 08:11 AM

UnityGUI elements (GUI.*) cannot be rotated at all, as far as I know. And the older GUIElement items probably can't be, either, since (even if they have a Transform component), they still occupy screen-space. So to answer your question, no, it's not possible, at least not without some third party script.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Jean-Fabre · Jan 26, 2011 at 04:58 AM 0
Share

see question below, it is actually possible.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Simple Menu(understanding GUI) 2 Answers

Resolution & aspect ratio GUI 1 Answer

Interface 3D 1 Answer

Detect GUI rotation degree 1 Answer

Rotate Texture2D around its center 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges