- Home /
How Do I Build My Application To The Size Of The Camera
I'm quite confused when it comes to resolutions and aspect ratios and the like. I'm trying to build my game to the size of the window viewable in the inspector and have it fixed so that it's not resizable.
I've tried sereral different ways about it but in all cases, I'll either end up with my GUI not being positioned correctly or having a black letter box view of the application.
You may want to clarify your question a little bit, as we readers have yet to know what have you done or what have gone wrong.
It might be a problem that beginner understand since I get exactly what he means, but having the same problem, cannot help at all.
I have one camera in my game. It allow me to see a certain amount of the game scene, like a tv screen. But when I build my game, I end up with a 'screen' of a completely different size, with my text sprawled all over the place except where I want it to be. Yet when I was setting it up in Unity, it was placed fine...
The problem is cause by unity saving your previous builds preferences, the nice method to fix this if to create a new c# script named PlayerPrefReset and copy and paste the following code into it.
using UnityEngine;
using UnityEditor;
using System.Collections;
public class PlayerPrefReset : EditorWindow {
[$$anonymous$$enuItem("Edit/Reset Playerprefs")]
public static void DeletePlayerPrefs(){
PlayerPrefs.DeleteAll();
}
}
Once you have that compiled go to Edit -> Reset Playerprefs and click. That will remove the preferences that keep stopping it working.
After that go to Edit > Project Settings > Player, and set up the appropriate stuff there e.g. not full screen, put in your specific resolution, probably set 'Show resolution dialog' to disable etc.
Answer by MechanicalGaming · Jan 09, 2015 at 12:30 AM
I had this problem when I first started... Go to "File" (on the menu bar) then onto "Build Settings..." and then a window will come up. On the bottom there is "Player Settings...". Once clicked, there will be a menu in the inspector, you can change the sceen size from there and then scale the camera view until it fits the square.
Edit: Just noticed this was asked in Jully... I'm guessing my answer was useless...
No no it wasn't... well sorta, I found the solution some $$anonymous$$utes before seeing your answer actually XD I did edit the player settings before, when I started making my game, but my UI text still was all over the place. To make it fixed, what I did was activate the "resize to fit screen" option on the Canvas, and pick the "Expand" sub-option. Now it's perfect ^^
Your answer
Follow this Question
Related Questions
Texture not showing 1 Answer
How could I deal with the resolution and camera size? 0 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Raycast in camera 1 Answer