about 6 years ago
One can easily change RectTransform right,left,top and bottom value using script in this way :-
object.GetComponent<RectTransform> ().offsetMin = new Vector2 (0,-1);//left-bottom
here "0" indicates Left value and "-1" indicates bottom value.
Similarly for setting Right and Top value use:
object.GetComponent<RectTransform> ().offsetMax = new Vector2 (0,1);//right-top
here "0" indicating Right value and "1" indicating Top value.
In my case value is 0 or 1. But it can be any value rather than 0 or 1.
e.g:-
object.GetComponent<RectTransform> ().offsetMin = new Vector2 (10,12);//left-bottom object.GetComponent<RectTransform> ().offsetMax = new Vector2 (20,40);//right-top
For more understanding :-
Hopefully this will be helpful for you.
Thanks!
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)