x


GUI item with object position+dimensions

As the title states; How can I place a GUI item on the same position with the same dimensions of an object? I tried using Camera.main.WorldToScreenPoint but that gives the object center pivot location which causes the GUI item's left top to be in the center of the object instead of the left top.

For the dimensions I thought I could use the scale of the object, but as GUI uses pixels instead of the units in the editor, that does not work.

I hope my question is clear enough and if not, let me know and i'll try to clarify it.

Thanks in advance.

more ▼

asked Dec 20 '11 at 11:27 PM

thurone gravatar image

thurone
35 7 8 9

I managed to get a bit further with this. I do have the size of the button texture and if i place that on the plane object but is there an option that resizes the plane object to the size of the texture? If not, i know it is possible to make a GUI with just objects and not with the GUI scripts, but how should i make items like checkboxes and radiobuttons that way?

Thanks in advance.

Dec 22 '11 at 09:52 AM thurone
(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:

x3694
x1281
x1095
x886
x388

asked: Dec 20 '11 at 11:27 PM

Seen: 702 times

Last Updated: Dec 22 '11 at 09:52 AM