x


Rotating a Rect by the GUI.matrix?

I am trying to create a mouse over event for buttons in my OnGUI method. The popular suggested way to do so is to use the Rect.Contains method; however, if I use GUIUtility.RotateAroundPivot then my Rect positions are in the wrong locations. How can I rotate the GUI elements, and then manipulate the Rect by that GUI.matrix?

more ▼

asked Jan 01 '11 at 12:49 AM

nrvllrgrs gravatar image

nrvllrgrs
12 1 2 4

RotateAroundPivot is the function to modify the GUI.matrix. Is the pivot point at the position you intend?

Jan 01 '11 at 01:54 AM uhahaha

Yes. All of the rotated GUI objects are at the desired locations. But I don't know how to use that modified matrix to rotate a rectangle to do a Contains check.

Jan 02 '11 at 06:20 PM nrvllrgrs
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3689
x71
x9

asked: Jan 01 '11 at 12:49 AM

Seen: 1282 times

Last Updated: Jan 01 '11 at 12:49 AM