GUI texture gameobject screen position.

Is it possible to place a GUITexture GameObject with relative screen co-ordinates rather than from the centre of the screen in the editor?

i.e. position from the right hand edge of the screen so that it will appear in the correct place no matter the resolution? Can I express this as a variable in code?

Cheers

there is no real easy way to do this, screen resolutions are not constant at all.

I looked at two options

One) link gui elelments to the camera and set them up to respect a certain aspect ratio that fits into all aspect ratios

Two) compute the scale of the resolution and adjust position accordingly

Thanks Rungy.

I found this code which updates the position of the GUITexture object so if i re-size the screen the GUItexture moves with it. I can then disable and re-enable the code as and when I need to and use an iTween to make the menus move in and out of the screen as I like.

Works pretty well.

function Update() {

	transform.position = Vector3.zero;
	guiTexture.pixelInset = Rect(Screen.width - 256,Screen.height - 32,256,32);
}