How would I go about moving the pivot of the rectTrans of a UI Image? I can do this in the editor no problem. Grab the blue circle that represents the pivot point, drag it about and only the pivot point changes position.
If I try and do the same using a script by:
myImage.rectTransform.pivot = newPosition;
This changes not only the pivot point where I want it, but also moves the entire rect in the opposite direction on screen. The editor apparently automatically compensates to keep the rect position fixed on screen. Can anyone tell me how it compensates?
The ultimate goal is to be able to scale the image around the pivot point and the image remaining stationary in relation to the pivot point. It is of course going to expand away from the pivot point.