i just started with unity again after a year long break and have forgotten everything about coding >.<
so my question, How do i get my GUI to stay directly in the middle of the X axis and to the bottom of the screen in the Y axis in any aspect of the game, it looks perfect on standalone (1024x768) but if i change to free aspect it goes out of wack?
ive tried many variations of thiscode but none work 
var HTexture : Texture;
var x = (0);
var y = (0);
function OnGUI() {
if(!HTexture){
Debug.LogError("Assign a Texture in the inspector.");
return;
}
GUI.DrawTexture(Rect(x,y,131,131), HTexture, ScaleMode.ScaleToFit, true , 0);
}
Any help would be greatly appreciated!
Thanks, Afrokid
Welcome back to Unity! Hope the coding knowledge is gradually returning.
Anyway, you need to determine where the centre of the screen is and position the texture relative to that. The Screen class has width and height properties that give you the dimensions of the display and if you divide each by two then you get the centre point. The X coordinate of the rectangle should then be positioned at the screen centre minus half the width of the texture. The Y coordinate should be equal to centre minus half the height:-
var centreX = Screen.width * 0.5;
var centreY = Screen.height * 0.5;
var texRect = new Rect(centreX - HTexture.width * 0.5, centreY - HTexture.height * 0.5, HTexture.width, HTexture.height);
ah, that makes sence but where do i add the texRect to?
GUI.DrawTexture(Rect(x,y,131,131), HTexture, ScaleMode.ScaleToFit, true , 0);
to:
GUI.DrawTexture(texRect, HTexture, ScaleMode.ScaleToFit, true , 0);
yeah i tried that but the GUI flies off of the screen?
i also just tried
var HTexture : Texture;
var x = (0);
var y = (0);
function OnGUI() {
if(!HTexture){
Debug.LogError("Assign a Texture in the inspector.");
return;
}
GUI.DrawTexture(Rect(Screen.width/2-329.5,Screen.height * 0.85,659,136), HTexture, ScaleMode.ScaleToFit, true , 0);
}
the x axis works perfectly but the Y axis sits right on my Free Aspect and the rest except for Standalone where 1/2 of it is hiding below the screen?