How do you make an Image button...where the background is my custom image...text is centered

The titles says it all

1 Answer

1

http://unity3d.com/support/documentation/Components/class-GUISkin.html

http://unity3d.com/support/documentation/Components/class-GUIStyle.html

Make a GUI skin or GUI style from the create menu in the project window (one that lists all assets)

Select button from the inspector menu

Select normal

Drag an image into the texture slot

Drag a font into the font box

Select middle centre for alignment

Apply the GUI skin or style to your GUI script e.g.

var customSkin : GUISkin;
function OnGUI(){
   GUI.skin = customSkin;
}

or

var customStyle : GUIStyle;
function OnGUI(){
   if(GUI.Button(someRect,"some text",customStyle)){
      // button was pressed
   }
}

Done