- Home /
Windowed game to fullscreen
Hi, For the past 1 to 2 months i have been making a simple child's games. Unity 4.0 Free . Building for windows.
The game is "2D"/Camera is static orthographic . The entire time during development i was building the game for Default screen width 1024 height 768 and i was testing on windowed. Now the game has to be in default Full screen. However all the images that i used for background(I have a plane) are with that size and when i switch to full screen it gets blurred as if with low quality. How do i make it that the background(plane) stay in the middle of the screen and not reside.(also the other objects)
I really do hope you can help me ;d.
Answer by jogidipen · May 28, 2013 at 07:39 PM
Create one script, apply it on main camera:
public float orthographicSize = 5;
public float aspect = 1.33333f;
void Start()
{
Camera.main.projectionMatrix = Matrix4x4.Ortho(
-orthographicSize * aspect, orthographicSize * aspect,
-orthographicSize, orthographicSize,
camera.nearClipPlane, camera.farClipPlane);
}
jogidipen Thank you very much for you answers. I didnt know about this. I did try with 1.333F my orthographic size is 5(dont know why i did this) but it does not have the right effect with 1.333F I will play around with the numbers. Again thank you very much
How would I have to set this up for a 1050 * 1680 $$anonymous$$ainCamera? If I just paste your code, it distorts my game severely.
I had the same problem and that script solved it :) thank you very much :) I just had to tweak the values to fit my setup and it worked :)
The script is notworking for me; it says, nearClipPlane annd farClipPlane cannot be found, if someone colud help me..
$$anonymous$$ake sure You are using orthographic camera.
Use Camera.main.nearClipPlane, Camera.main.farClipPlane in place of camera.nearClipPlane, camera.farClipPlane.
$$anonymous$$ake sure you are using proper orthographic size and aspect ratio,
what are the proper values? how do they change the solution?$$anonymous$$ake sure you are using proper orthographic size and aspect ratio
Answer by Graham-Dunnett · May 28, 2013 at 12:01 PM
Maybe set up a 1024x768 rect for the camera to draw into?