How do I change the GUI.Label anchor point?

When using GUI.Label how can I base the text/image’s location off of the label’s center or right instead of the left? Thanks.

There’s no built in way to do this, but you could write a function that takes whatever anchor and returns the rect in upper corner anchor:

 function LowerRight(x : float, y : float, width : float, height : float) : Rect {
    return Rect(x-width, y-height, width, height);
}

Another thing I often do is use Rect.center to position the rect:

var rect = Rect(0,0,100,50);
rect.center = Vector2(Screen.width / 2, Screen.height / 2);