Hello! I designed this GUI for the system I am developing. I am not experienced with Unity, especially when it comes to GUI implementation. I started reading tutorials and basics of Unity GUI but I still couldn’t figure out the best way to solve my problem.
So I have the design, in the image below. As you can see the entire screen is covered with GUI. And in the middle there is an interactive area that user does stuff, mostly with mouse clicks. I implemented the system without a GUI. I have the user input hard coded for the test purposes.
I wonder if it is possible to implement something like in the image. From the examples I saw so far, most GUI elements are independent windows or buttons on the actual scene. In my case I sort of want to have the scene run within a GUI. Get the selections made in the GUI and interact with the scene. I would like to get some insights from you guys. I am confused about which direction to take.
I suppose I dont really understand your question, but I think what you are asking is that you want to make GUI buttons that interact with the user…if that so! Then you could take two routes that I am aware of. You can make individual textures for the buttons, you will attach the texture of a an empty GameObject and then attach a script in which accepts the OnMouseDown() calls. This gives you the ability to move your textures where across the HUD that you please. You can do that, or create one big GUI HUD that has all the graphics attached to it, then just place empty GameObjects over the button graphics display and then, again, put a OnMouseDown() script on the GameObject.
Essentially with creating an interactive HUD, it will be a series of empty GameObjects that have the scripts to make everything work. And then you can get creative and link them together or give them character via code.
Hope if that is what you were looking for and/ or helps.
As GC83 is saying… the question is not that clear. Is it correct that you want to resize the MainCamera (Camera pointed at your 3D level) down so it fits the ‘interactive’ camera?
If so you can change the ViewPort settings of the camera pointed to the scene (level) to fit that area and I’m not sure but if you draw gui stuff on it, it should appear on the entire screen and not just the Camera’s viewport.
If it doesn’t appear on the whole GameView window you might be able to fix this by adding another camera with default ViewPort settings and it’s culling mask set to nothing (it does not need to draw any object) and add the GUI script on there, but I don’t think this last thing is necessary.