- Home /
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.
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.