i'm new in unity .. i have developed one game according to 800 * 480 resolution and my camera Projection is orthographic .
when i run it for 800 * 480 resolution it works fine but now i want to run the same game for iphone4 , ipad wide and i see blue screen (unity default background) appears on the top and and bottom
and blue screen (unity default background) appears on the left for iphone 5 ..
i don't know what to do .. any suggestion ? ?
Answer by moghes
Apr 04, 2013 at 01:48 PM
Before to use any guitexture or position any guiTexture or guiText , you have to get the Screen Resolution, dpi, width and height and assign you dimensions accordingly.
Here's a simple example:
public var myBackground:GUITexture;
public var otherImage:GUITexture;
// let us say otherImage is a button(texture) at the middle of the screen
myBackground.pixelInset.width = Screen.currentResolution.width;
myBackground.pixelInset.height = Screen.currentResolution.height;
myBackground.pixelInset.x = 0;
myBackground.pixelInset.y = 0;
// now ur background is full screen
// don't use Screen.Width in this case
otherImage.pixelInset.width = Screen.width/4;
otherImage.pixelInset.height = Screen.height/4;
otherImage.pixelInset.x = Screen.width/2 - Screen.width/4;
otherImage.pixelInset.y = Screen.height/4 - Screen.height/4;
don't forget to set the trasform positions all to zeros in the inspector.
it works fine for guiTexture or guiText
the problem is with the real game .. i have made main menu using GUItexture main menu works fine problem is with the game scene
i've read many questions ..
i get to know that problem is with the camera projection .. in my game its orthographic
what do you have in your main scene? what are the assets?
A couple of Cubes and a sphere..with a single camera with orthographic projection..
@mayurbhagat check this link:
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
12 People are following this question.
Where is Reference Resolution in new version?
Resolution scaling not working correctly.
Use different sprites in new Unity UI for SD vs HD
Game view sizes in Unity 5
Make camera have a fixed screen size