- Home /
Filling the screen doesn't...
I use the code below to fill the screen with a texture. Only sometimes it doesn't fill the entire screen. Any ideas why?
GUI.DrawTexture(Rect(0,0,Screen.width,Screen.height),FillTexture, ScaleMode.StretchToFill, true, 0);
The problem is occurring on a Samsung Galaxy S. The first time the scene runs it only fills 8/10 of the screen.
However it does fill the screen when the scene is loaded the second time (returning to main menu from the level select).
What the hell could cause the same self-contained line of code to work only the second time the scene runs????
$$anonymous$$aybe the Screen properties are not correctly set when you run the scene the first time (although they should be!). Use a rect with fixed values just to check this possibility.
Answer by PaulUsul · Jun 16, 2011 at 09:33 AM
Don't use the last parameter, right now you are setting imageAspect to 0. The only thing I can think of. Or your FillTexture is totally foobar, but what are the chances :p
I've removed the image aspect parameter and it seems to work ok now (testing on iPhone4). Need to switch and build on Android again to make sure it's not related to the device... I'll get back to you on that later. Thanks.