RectTransform Left Right Bottom Top
Hello, I have a problem whith my RectTransform. I want establish the "Left, Boytom, Right and Top". This is my code
droppedItem.GetComponent ().anchorMin = new Vector2 (0.1733659f, 0.1828558f); droppedItem.GetComponent ().anchorMax = new Vector2 (0.8060001f, 0.7914279f); droppedItem.GetComponent ().offsetMin = Vector2.one; droppedItem.GetComponent ().offsetMax = Vector2.one; droppedItem.GetComponent ().rotation = Quaternion.Euler (0, 0, 0);
This runs every time I move an inventory item. The problem comes when I move the item, it does not respect what I have set in the code and the image is stretched
The element is a prefabricated one that has its values well established but not respected either
Your answer
Follow this Question
Related Questions
UI RectTransform.rect.width/heigth returns incorrect/negative values 0 Answers
Using downloaded image as UI Image's source image? 1 Answer
How to offset a RectTransform? 0 Answers
UnityEngine.UI and UnityEngine.EventSystem do not work, what do I do? 1 Answer
Runtime GUI Positioning - Making Chat 0 Answers