So, I’ve been trying to make a GUI.Box with a transparent center, and a black outline. I have tried several combinations (Setting a texture transparent, adding outline, all at runtime, setting texture, making outline in another function with other guis), and none of it is working. The gui is scaled to your screen so I can’t just make a texture for it. Sometimes I can see the transparency but no outline, no transparency + an outline, outline but everything behind it disappears (?). Can anyone help me out?
So you need to make a 9 slice texture. A simple small version of the outline. Then you tell the GUIStyle to use a border which indicates which parts should be rendered as is and which should be stretched.
NHN
VSV
NHN
The border indicates how wide and tall the corners are, these N marked are not stretched. The H are stretched horizontally. The V are stretched vertically and the centre (transparent in your case) is stretched in both directions so that the texture fits your area.