I am using the following script to make a gui button. How can I edit the transparency of this button?
function OnGUI () {
if (GUI.Button (Rect (25, 25, 500, 50), "Play")) {
}
I am using the following script to make a gui button. How can I edit the transparency of this button?
function OnGUI () {
if (GUI.Button (Rect (25, 25, 500, 50), "Play")) {
}
By using another skin. The transparency is part of the button texture itself. You can design your own buttons by creating a custom GUISkin and replace the textures with your own.
To use your skin you need to tell Unity to use it in OnGUI.
var mySkin : GUISkin; // assign your skin in the inspector
function OnGUI ()
{
GUI.skin = mySkin;
if (GUI.Button (Rect (25,25,500,50), "Play"))
// ...
}
Make a new style or skin with a solid button texture and use that in the button.