Create a GUITexture
:(Menu → GameObject → Create other-> GUITexture)
This is an object in your gamescene, the transform’ position of this object is tricky:
transform.position.x or y has to be between 0 or 1. For x, 0 is the most left side of the screen, 1 is the most right side of the screen, and for y, 0 is the most down side, and 1 most top, no matter the size of the screen!
GUITexture.pixelInset is something total different, this gives you the ability to reposition/size the texture from the relative point you’ve chosen with the transform.position positions (some kind of margin or padding)
So when setting the transform.position.x/y to 0, it should be position at the down-left corner of your screen (yes x:0, y:0 in GUI textures is downleft) and now we can scale the texture to the screen pixel size:
Oh yea, the transform.position.z is the index overlay, so other GUITextures with higher/lower values will be behind/above this texture.
So to actually turn this magic into pixels, attach a GUITexture into the scripts inspector, and almost forgot: attach a texture in the GUITexture 
GL
public GUITexture textureOverlay;
public int overlayDepth = 1;
private bool menuEnabled = false;
void Start()
{
//on start, make texture same size as the screen.
textureOverlay.transform.position = new Vector3(0, 0, overlayDepth);
textureOverlay.pixelInset = new Rect(0, 0, Screen.width, Screen.height);
textureOverlay.enabled = false;
}
void Update()
{
//toggle menu on escape key up
if(Input.GetKeyUp(KeyCode.Escape))
{
menuEnabled = !menuEnabled;
}
//show or hide texture
switch (menuEnabled)
{
case true:
if(!textureOverlay.enabled)
textureOverlay.enabled = true;
break;
case false:
if(textureOverlay.enabled)
textureOverlay.enabled = false;
break;
}
}