Hi, I need to make a Button. But originally the Button is a Black box, with Text inside. I need to create a Button without the black box and only the Text.
Please help.
Hi, I need to make a Button. But originally the Button is a Black box, with Text inside. I need to create a Button without the black box and only the Text.
Please help.
Hey there,
All you have to do is overwrite the style and it will work.
if(GUILayout.Button("Just Text", EditorStyles.label))
{
Debug.Log( "PRESSED" );
}
Regards,
Hi. Can you tell what EditorStyles.label does?
Styles are just a collection of settings about fonts, button states, and backgrounds. A button is just GUI.skin.button. Editor styles are just the ones used by the editor. There is no need to create your own style when the editor has one already.
Got it! And is there a way to make GUI skins instead if the default black box? Custom GUI button styles?
You can make one in code pretty easily by just going GUIStyle style = new GUIStyle() and setting the options from there Or you can make a GUISkin (just a collection of GUIStyles) in editor and import it.
Ok Thanks!