- Home /
Question by
paco morales · Dec 18, 2012 at 09:16 PM ·
guibuttons
How to assign different texture to a GUI skin
Hello,
I'm trying to put some buttons to an interface of an application and I using different textures and dimension for each button with different function.
I don't want to show text in my buttons because I'm using symbols in the textures.
I have tried to use a texture as a button but I have to make a different Scripts for each one.
Please take a look to my script and the screenshots
Thanks in advance
var beep : AudioClip;
var menuSkin : GUISkin;
var menuArea : Rect;
var powerButton : Rect;
var batteryButton : Rect;
var keyButton : Rect;
function OnGUI(){
GUI.skin = menuSkin;
GUI.BeginGroup (menuArea);
if(GUI.Button(Rect(powerButton), "")){
}
if(GUI.Button(Rect(batteryButton), "")){
}
if(GUI.Button(Rect(keyButton), "")){
}
GUI.EndGroup();
}
function Update () {
}
@script RequireComponent(AudioSource)
this is my problem.jpg
(37.8 kB)
this is the idea.jpg
(33.8 kB)
Comment