how to stretch a guiTexture to fill screen?.

Hi…

i know how to stretch a texture but now i´m trying to detect the screen limits for a guiTexture that contains an animation of vertical movement.

is there a way?

Thanks. !

I think you need this the Screen.height and Screen.width reads the screen height and width

This is a small script I use to rescale background textures. It only works properly if the aspect ratio doesn’t change, but it should be easy to adapt it:

function Start() {
	guiTexture.pixelInset.width = Screen.width;
	guiTexture.pixelInset.height = Screen.height;
	guiTexture.pixelInset.x = -Screen.width/2;
	guiTexture.pixelInset.y = -Screen.height/2;
}

You may also have to put your texture at the 0.5 / 0.5 coordinates, but since that’s the default anyways… don’t know if it works if you don’t.

perfect :wink: thanks for that last code thanks both 1º1