Does anybody know how to create a border in unity3d? As i tried modify the setting under the normalised rect in the inspector view. However, i only manage to acheive 4 different camera scene showing side by side but i wanted to show my GUI border texture as well. Does anyone know how? Do i need to script it in order to acheive that?
I am new in the GUI scripting. I hope someone may help to give some guidelines and advice. Thanks
Attach is the image that i would like to acheive. Thanks in advance.
If you’re cameras are positioned as above, and they’re each set to half the width and height, then you’re leaving zero room for your border. Try using a width/height of slightly less than 0.5, and a x value for the left two camera of slightly more than zero
I have tried your method, however i am still unable to get my border out. Base on my understanding you mention that i need to change the value for width/height and x value in the inspector right?
However when i change the setting for my height and width value and adjust the x value to more than 1, my border seem to appear in front of my scene and my camera scene have disappear.
This is the current setting that i have in my inspector for each of my camera:
Camera A
Width: 1
Height: 1
X: 0.55
Y: 0.55
Camera B
Width : 1
height: 1
X: 0.55
Y: -0.55
Camera C
Width: 1
height : 1
X : -0.55
Y-: -0.55
Camera D
Width: 1
Height: 1
X: -0.55
Y: 0.55
Now i have create my border appear in the middle but i want to create my border to appear at the side.
Hope you can help me again. Really Thanks in advance.
Can you please post a screenshot of what is happening on your end? A nice tidy image showing not only the game view (with your cameras) but also the Inspector with your settings would be helpful.
Edit: I ask that as I find it very puzzling that you even see these things layered too much as you have every one of your cameras set to a width and height of 1.0 (full screen!?) and your x/y positions are all quite curious so I’m wondering how your description even matches up to the numbers shown.
And as one final bit of help here I’ll offer the values I just spent about 30 seconds coming up with. In all seriousness, this is not a difficult thing to sort out and I think that you should spent 10-15 minutes and just sit there and play with values. It’s all just Inspector settings and with a little trial and error you should be able to sort all this out.
Hi Tom, Really thanks for your reply but i am sorry as i have another enquiries regarding this topic.
I hope anyone can help by giving me some advice or guidelines again.
As currently i am using my camera to target on a plane with my border texture attach on it. I did get my border texture out. However, i realize whenever i resize my unity3D file or set my exe files to a lower resolution, my border actually went out of its original size, 1024 by 768 or the border texture become smaller.
Was thinking is it possible to standardize my border texture to 1024 * 768 at all time so that even when i resize my file or lower my resolution, my border texture will still be seen? Thanks.
Or write some code that monitors the screen resolution and sets those values as necessary. All of that camera information (normalized view port info) is available via scripting, if you want run-time updates with different screen sizes then you can write code to do that. Look up Camera.rect.
i still have some doubt regarding this post. You stated that i can write some code to monitors the screen resolution base on the reference from the Camera.rect. However, it don’t seem to be working in my project files. I don’t know which part of the coding does it actually show the editing under the normalized view port info. I hope you don’t mind explaining this. Thanks in advance.
What i actually wanted is that as mention earlier, i will have 4 sub camera in my scene and 1 main camera looking at my interface. Right now, i need to position my 4 sub camera inside this interface but now my interface will need to consist with a border for each camera.
Hence, I realise i met with a serious problem such that my border will never be in line with my 4 sub camera. It will either move slight to the left or right. Do you have any idea which i can acheive the output as following? Thanks in advance.
Do you have “holes” in your background image? If so, why? Make it solid all the way and then your cameras will always appear to fit nicely (as in reality the background paints across the entire monitor).
Otherwise my comments about monitoring the screen resolution are mostly the same as was discussed in your WASD buttons thread. Look at the screen size, from that you determine where, percentage/relative wise you want things (like cameras) placed so you can compute their positions in values that range from 0 to 1.0 instead of 0 to (Screen width/height).