Texture on center bottom of screen

Hi,

I have a texture that I want to show on the center bottom of the screen. I know how to get it to the center of the screen, but how do I get it to the bottom?

var show : boolean;
var inventory : Texture2D;

function OnGUI () {
	GUI.depth = 100;
	if(show){
		//show inventory bar
		GUI.DrawTexture(new Rect(Screen.width / 2, Screen.height / 2,248,46), inventory);
	}
}

GUI.DrawTexture(new Rect(Screen.width / 2, Screen.height - Screen.height,248,46), inventory);

var show : boolean;
var inventory : Texture2D;
private var gui : GUITexture; //Reference to the GUITexture component of this gameObject

function Awake() {
    
 gui = GetComponent("GUITexture"); //Gather the reference for the GUITexture component
    		
    	gui.texture = inventory;
    	gui.pixelInset.x = Screen.width / 2;
    	gui.pixelInset.y = Screen.height - Screen.height;
    }

Hello. I think this might do the job:

var show : boolean;
var inventory : Texture2D;

private var inventoryW : float;
private var inventoryH : float;

// Store the inventory W / H in these 2 vars
function Start()
{
	inventoryW = inventory.width / 2;
	inventoryH = inventory.height;
}


function OnGUI () {
    GUI.depth = 100;
    if(show){
       //show inventory bar
       GUI.DrawTexture(Rect(Screen.width / 2 - inventoryW, Screen.height - inventoryH, 248,46), inventory);
    }
}

I think that shoud work…

You simply have to take the Screen.height and since it start from TOP to BOTTOM if you’r screen.height is 600 then 600 will be at the bottom line. So you remove 248 from 600 and you’r texture will be exactly above the bottom line.