Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
2
Question by 3DMagicVR · Jan 27, 2011 at 03:49 AM · rotaterectpivotguiutility

RotateAroundPivot rong offset

Hi every one, working with the GUIUtility RotateAroundPivot I got this weird situation.

when try to center A GUIButton with the Screen.width and the Screen.height and drag the corner of the window to resize it, the button move away from the center but the pivot point remains on the center of the screen, but when I use direct numbers (400 - 40, 300 - 40) the button remains on the center but the pivot not, this is the code:

var rectButton : Rect = Rect(0, 0, 80, 80);
private var refAngle = float;
// With a function to increase the refAngle value
function ONGUI() {
    GUI.matrix = Matrix4x4.TRS(Vectro3.zero, Quaternion.identity, Vector3(Screen.width / 600.0, Screen.height / 600.0, 1));
    GUI.BeginGroup(new Rect(Screen.width / 2 - rectButton.width / 2, Screen.height / 2 - rectButton.height / 2, rectButton.width, rectButton.height));
    GUIUtility.RotateAroundPivot(refAngle, Vector2(40, 40));
    GUI.Box(Rect(0, 0, 80, 80), "Spin");
    GUI.EndGroup();
}

Any help will be very appreciated, for you attention thanks.

Comment
Add comment · Show 4
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 3DMagicVR · Jan 31, 2011 at 07:04 PM 0
Share

Hi every one, I found how to solve this little problem by myself, I will post the code the next time.

avatar image Krummelz · May 08, 2013 at 07:24 AM 0
Share

Are you still going to post an answer some time?

avatar image Nition · Oct 09, 2013 at 02:36 AM 0
Share

It must be a really long answer.

avatar image Nition · Dec 16, 2014 at 10:28 PM 0
Share

December 2014. Almost four years have passed, and some of us are beginning to lose hope that 3D$$anonymous$$agicVR will post the code. $$anonymous$$ost of the original group have long gone, and only a few of us remain now to keep watch for 3D$$anonymous$$agicVR's post.

Sometimes we despair: How much longer will he keep us waiting? But other times we rejoice - imagine how detailed and informative the post must be, after this much time to work on it!

0 Replies

· Add your reply
  • Sort: 

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

2 People are following this question.

avatar image avatar image

Related Questions

Is There An OnMouseStop? 0 Answers

GUIUtility.RotateAroundPivot causes blurred text 0 Answers

Camera Rotating Around (0, 0, 0) 2 Answers

something to do with pivot 1 Answer

Can't rotate viewport 2 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