resolution

Hi, i am making a game for the resolution of 1024768.
I have a background texture of 1024
768.

if i am going to export in 800*600, then my background texture will be bigger than the exported resolution.
So which GUI code should I use and prevent that problem from happening… Thanks.

The GUI.DrawTexture function has a parameter called scaleMode that lets you specify how you want an image to be fitted into the rectangle. You can have it cropped, squeezed, etc.

But my mesh in the scene will be covered by GUI. How?

I’m tryng to do the same.
Did you managed to find a way to do this ? (Getting a background image to work without covering your meshes/sprites ?

you can use a second camera to draw only the background image (using layers). Then set this camera and the main camera to depth only and then set the depth to control which one renders on top of the other.

Thanks ivkoni, but that won’t work either., i had already tryed that.
Other camera GUI’s (gui.drawtexture or graphics.drawtexture) are rendered last on top of all cameras.

try again :slight_smile:

it does work, and I use it here:

the background is a gui texture in a separate layer rendered by one camera that is set to cull every other layer and its depth is 0.
The other gui elements and the objects are rendered by the main camera, which is set to cull the background layer only and has depth 1.
If there is a better solution, sorry I don’t know it.