right, sorry :S
anyway, i have edited the code again, and i have this now:
var resumeBtnTex : Texture;
var menuBgTex : Texture;
var menuBorderTex : Texture;
function OnGUI()
{
GUILayout.BeginArea (Rect (Screen.width / 2 - 128, Screen.height / 2 - 128, 512, 512));
GUILayout.Button (resumeBtnTex);
GUILayout.Box (menuBgTex);
GUILayout.Box (menuBorderTex);
GUILayout.EndArea();
}
problem is, it only displays the button with my texture, but then also with the unity default texture wrapped around it.
and it only shows the boxes as a long bar under the button.
how should i fix that?
EDIT:
i have edited the code a bit and given the boxes a fixed size, but still not displaying the texture:
var resumeBtnTex : Texture;
var menuBgTex : Texture;
var menuBorderTex : Texture;
function OnGUI()
{
GUILayout.BeginArea (Rect (Screen.width / 2 - 128, Screen.height / 2 - 128, 512, 512));
GUILayout.Button (resumeBtnTex , (GUILayout.Width(256)) , (GUILayout.Height(64)));
GUILayout.Box (menuBgTex , (GUILayout.Width(512)) , (GUILayout.Height(512)));
GUILayout.Box (menuBorderTex , (GUILayout.Width(512)) , (GUILayout.Height(512)));
GUILayout.EndArea();
}
EDIT2: oh, and i changed GUIStyle to Texture because with GUIStyle, it wouldnt display anything at all, even after assigning textures and stuff in the inspector.
EDIT3: so i have been editing the code AGAIN, and it sort of improved but still not right…
Now it displays the textures, but i dont know how to position them properly in this code:
var resumeBtn : GUIStyle;
var menuBg : GUIStyle;
function OnGUI()
{
GUILayout.BeginArea (Rect (Screen.width / 2 - 128, Screen.height / 2 - 128, 512, 512));
GUI.skin.button = resumeBtn;
GUILayout.Button(" ");
GUI.skin.box = menuBg;
GUILayout.Box(" ");
GUILayout.EndArea();
}