Синтаксис:
Используется javascript
var style : GUIStyle;
function OnGUI(){
if (GUI.Button(Rect (0,Screen.height/10,Screen.width/6,Screen.height*9/10), "I \n N \n F \n O", style)){
Application.LoadLevel (2);
}
if (GUI.Button(Rect (Screen.width*13/60,Screen.height*3/20,Screen.width*41/120,Screen.height*7/30), "New Game", style)){
Application.LoadLevel (0);
}
if (GUI.Button(Rect (Screen.width*73/120,Screen.height*35/120,Screen.width*41/120,Screen.height*7/30), "Instruction", style)){
Application.LoadLevel (3);
}
if (GUI.Button(Rect (Screen.width*13/60,Screen.height*13/30,Screen.width*41/120,Screen.height*7/30), "Option", style)){
Application.LoadLevel (4);
}
if (GUI.Button(Rect (Screen.width*73/120,Screen.height*69/120,Screen.width*41/120,Screen.height*7/30), "About",style)){
Application.LoadLevel (5);
}
if (GUI.Button(Rect (Screen.width*13/60,Screen.height*43/60,Screen.width*41/120,Screen.height*7/30), "Exit",style)){
Application.Quit ();
}
}
function OnGUI(){
if (GUI.Button(Rect (0,Screen.height/10,Screen.width/6,Screen.height*9/10), "I \n N \n F \n O", style)){
Application.LoadLevel (2);
}
if (GUI.Button(Rect (Screen.width*13/60,Screen.height*3/20,Screen.width*41/120,Screen.height*7/30), "New Game", style)){
Application.LoadLevel (0);
}
if (GUI.Button(Rect (Screen.width*73/120,Screen.height*35/120,Screen.width*41/120,Screen.height*7/30), "Instruction", style)){
Application.LoadLevel (3);
}
if (GUI.Button(Rect (Screen.width*13/60,Screen.height*13/30,Screen.width*41/120,Screen.height*7/30), "Option", style)){
Application.LoadLevel (4);
}
if (GUI.Button(Rect (Screen.width*73/120,Screen.height*69/120,Screen.width*41/120,Screen.height*7/30), "About",style)){
Application.LoadLevel (5);
}
if (GUI.Button(Rect (Screen.width*13/60,Screen.height*43/60,Screen.width*41/120,Screen.height*7/30), "Exit",style)){
Application.Quit ();
}
}
Во всех кнопках есть стиль. Я изменил шрифт, размер и т.д, Включая текстуру на кнопке. Я нарисовал текстуру (круг зеленый) вокруг круга у меня все закрыто ластиком. Тоесть прозрачный фон. Но когда поставлю текстуру в Стиль то фон не прозрачный, а белый. Как это исправить? http://hkar.ru/xLtC