I would like to load a GUI.Button so that only the image assigned to it appears without the frame of the button on the screen. Is this possible?
The best and simplest solution is to use what you may call the blank style.
This works with text and texture buttons and it also applies to other GUI elements.
You can create one by using new GUIStyle()
but the prefered way is to use the GUIStyle.none
static member.
For example:
GUI.Button(someRect, someText, GUIStyle.none);
Like dannyskim says, take a look at GUIStyles to fully customize everything about your GUI elements.
You could also draw a button using the Label style like this:
/* get the label style from the current GUI skin */
var labelStyle : GUIStyle = GUI.skin.label;
GUI.Button(someRect, someText, labelStyle);
The default GUIStyle for labels has no frame or image associated with it.
Try putting this piece of code: GUI.backgroundColor = new Color(0,0,0,0); infront of your GUI.Button code.
for example:
//back button
GUI.backgroundColor = new Color(0,0,0,0);
if(GUI.Button(new Rect(5*Screen.width/100-Screen.height/12, 44*Screen.height/50, Screen.height/8, Screen.height/8), BackButton))
{
/*go back;*/
}
It worked for me.