Sorry if this has been covered before somewhere . . . I was unable to locate it with the limited patience I have at this point.
I’m trying to use a Label to create a fullscreen splash screen using Unity iPhone Basic 1.5. Normally I would just use GUITexture, but I’m trying to respect Unity’s decision to phase out the old GUI system in favor of this new one. But really, why’s it gotta be so much more complicated???
Anyway, the iPhone’s screen resolution is reported to be 480 x 320 pixels. So I’ve created an image that is 480 x 320 pixels and is used in the following code:
var splashTexture : Texture2D; // Texture for the splash screen (needs to be 480 by 320)
// 'cause GUI.Label doesn't resize anything either :P
function OnGUI () {
// Draws the splash screen
GUI.Label(Rect(0, 0, 480, 320), splashTexture);
}
Seems like that would work, but alas I get a small border around my image when the code is run (about 3 pixels wide on top and bottom and about 10 pixels wide on the right side – seems to be flush on the left side).
If I use the following as my code:
...
GUI.Label(Rect(0, -3, 480 + 10, 320 + 10), splashTexture);
...
The image fills the screen correctly.
Can anyone tell me why the GUI.Label seems to draw a 3-4% smaller area than the size it’s given with a height offset of about 3 pixels?
. . . For now I’m gong to eschew the whole thing and simply draw planes with materials on them, at least then I can get exact scaling and positioning. I’d still like to know what’s going on with that GUI.Label if possible, though . … I’m trying!
Thanks,
~Rob