Draw GUI texture from it's center point.


Is there any way to draw a GUI texture from it's center point instead of it's upper left corner?

I'd need to do that for a scripted GUI animation.

Thank you.

Found how, I negate my width and height position by half their equivalent in texture size.

GUI.DrawTexture(Rect(((Screen.width/2)-(tWidth/2)),((Screen.height/2)-(tHeight/2)),tWidth,tHeight), Texture, ScaleMode.ScaleToFit, true, 0.0f);

Just take the value of your screen resolution, and divide it

(Screen.width /2), (Screen.height /2)