Image does not match resolution

Hey all,
I just started up my Unity iPhone and made a GUI where I use a background image. The image is 480x320 pixels, same as the iPhone resolution. But it does not fill the screen, neither in the editor or on the iPhone when I run the app.

Why is this? Am I missing something here? Should the texture not fill the screen when it´s the same resolution?

How far off is it?

Are you specifying the correct Rect dimensions when you draw?

Is the image getting scaled on import? (Right-click, import settings)

Are you using GUI.Label to draw the image? If you use GUI.DrawTexture instead, you might find the problem disappears.

I tried GUI.DrawTexture and that solved it, almost :).
The texture still starts 2-3 pixels lower than the top of the screen though.

Solved it.
I used scalemode and that did something, when I removed it it works ok. Thanks for help.

Interesting… I’m running into the same issue.

An image sized 320 x 480 this code:

var startBG : Texture2D;
GUI.Label (Rect (0, 0, 320, 480), startBG);

… should work. But it does leave a gap around the top, right and bottom. It seems to be a scaling issue (??) as well… Where it seems to be trying to keep the aspect ratio intact but fit it into a lable box with a pad??

You can sort of fake it with:

GUI.Label (Rect (0, -3, 330, 490), startBG);

Does anyone know why GUI.Label does not work? Is it a pad issue? Or a bug?

I’ll try GUI.DrawTexture and see where it takes me, but it would be good to know the reason why it’s not working.